How can I use jQuery in Adobe Brackets? Plz help

I have searched the web and watched the videos I got it but the jQuery doesn’t work in Brackets when I Live Preview it on Google Chrome.

I have put main.js and jquery-3.2.1.min.js in the same folder but it doesn’t run. I put CDNs from different websites but it still doesn’t run.

No point in learning something if u can’t apply it.

Plz help!!!

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
      <link rel="stylesheet" type="text/css" href="styles.css">
      <script type="text/javascript" src="scripts/jquery-3.2.1.min.js"></script>
      <script type="text/javascript" src="scripts/main.js"></script>
    <title>My test Page</title>
  </head>
  <body>
    <h4>jQuery Tests</h4>  
      <div class="red"></div>
      <div class="blue"></div>
      <div class="grey"></div>
      <div class="green"></div>
    </body>
</html>

The jQuery is in the main.js file.

$(document).ready(function() {
    $('.red').click(function() {
        $('.red').fadeOut('slow')
    });
    $('.green').hover(function() {
        $('.green').height("160px")
    });
})

try using an external jquery link,

<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
2 Likes

It worked but I changed the code a little but it is still running the old one. I want to fadeOut the .green div when the mouseenters but it is still increasing the height.

This happened before also.

1 Like

Lemme see your updated index.html file

1 Like

you need to refresh the page after changes are made

As to why jquery isn’t working, we need to see the directory and all files, ideally, upload it to github

1 Like

how can i do that? Upload them on GitHub?

I’m don’t know how to use GitHub I’m new to all this but I will create an account right now and get back to you. :v:

1 Like

I have refreshed every time and I have used different versions of jQuery and also put the CDN code but it is not working

1 Like

once you registered, you also need to install the desktop program, to sync to github

upload the directory containing all files to github so we can have a look

1 Like

Ok i will do that and get back

1 Like

There’s an awesome, in-depth course on CC about GIT:

https://www.codecademy.com/learn/learn-git

1 Like

Sorry I’m unable to upload the folder. I am trying to “add an existing project on my computer and publish it on GitHub” It’s saying that that path is not a git repository.

1 Like

okay, github would have been ideal, given its specifically for coding. Is it possible to upload to dropbox/google drive and then share?

1 Like

Yes I can share the folder with you on dropbox

1 Like

I will take the git course too so that it’s easier next time

1 Like

did you install github desktop? click: create new repository, select the folder containing your files, and give the repository a name

1 Like

Yes I have installed git desktop and have created a new repository and have selected the folder

1 Like

add the files and directories, press: publish on github and give us the url to repository.

the git course is still worth it, given git is also version control

2 Likes

It says repository creation failed. Although I have already created a new repository. I’m still trying

2 Likes

stupid program. Just go to your repository on github.com, and select: add files and upload the files and directories (i am used to command line version on linux, so not really familiar with this program for windows)

1 Like

I’m on mac. Searching in google how to upload the files.

1 Like