How can I use jQuery in Adobe Brackets? Plz help


#1

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")
    });
})

#2

try using an external jquery link,

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

#3

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.


#4

Lemme see your updated index.html file


#5

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


#6

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:


#7

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


#8

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


#9

Ok i will do that and get back


#10

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

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


#11

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.


#12

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


#13

Yes I can share the folder with you on dropbox


#14

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


#15

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


#16

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


#17

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


#18

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


#19

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)


#20

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