Thursday, 15 April 2010

simple jQuery not working when uploaded -



simple jQuery not working when uploaded -

so i've been learning jquery , fiddling around basic functions, , testing in different platforms.

the thing is, next code works on browsers on mac (safari, chrome, firefox) when it's locally hosted (the file:///users/janey/testing/test.html kind of thing), when it's uploaded, stops working on safari (it works on both safari mac , ios safari)

here's html code:

<!doctype html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=0.5 maximum-scale=1.0"> <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"> </script> <link rel="stylesheet" href="resources/test.css" type="text/css"> </head> <body> <script src="resources/jquerytest.js"></script> <div id="button">button 1</div><br> <div id="buttons">button 2</div><br> <div id="hide">hider</div><br> <div id="show">shower</div><br> <div id="toggle">toggler</div><br> </body> </html>

and jquery file such:

$(document).ready(function(){ $("#show").hide(); $("#hide").show(); $("#button").click(function() { $("#toggle").toggle(); $("#hide").hide(); $("#show").show(); }); $("#buttons").click(function() { $("#toggle").toggle(); $("#show").hide(); $("#hide").show(); }); });

tester here: https://00c3c1ad2091a7f217bcb0c02dcd4786bc9fd492.googledrive.com/host/0b9xdkesfy3ddtuzna254zk1rylu/test.html

what missing? help appreciated!

to expand farther on akhlesh's comment

if run page , press f12 , check console you'll see error talking about.

try changing this:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>

to this:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>

jquery

No comments:

Post a Comment