jquery - Use jqueryui in index.html -


i finished codecademy tutorials on html, css, js , jquery. trying create on own. can't make simplest thing work. did in kind of "browser consele lab" till now. question is, how use or include jquery in index.html work when open in browser? after searching used google hosted libraries links still doesn't work. have 3 files created: index.html, style.css , script.js.

now loads page square on it, nothing when click it, tho jquery code should correct.

index.html code:

<!doctype html> <html> <head>     <title>my thing</title>     <link rel='stylesheet' type='text/css' href='style.css'/>     <script type='text/javascript' src='script.js'></script>     <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>     <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>  </head> <body>     <div>     </div> </body> </html> 

style.css code:

div { height: 250px; width: 250px; background-color: #008800; } 

script.js code:

$(document).ready(function(){   $('div').click(function(){       $(this).effect('explode');   }); }); 

it should be

<!doctype html> <html> <head>     <title>my thing</title>     <link rel='stylesheet' type='text/css' href='style.css'/>     <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>     <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>     <script type='text/javascript' src='script.js'></script>  </head> <body>     <div>     </div> </body> </html> 

your script page script.js used jquery, should included after jquery library

demo: plunker


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -