Let's say this my page for example ..
<!doctype html>
<html>
<head>
</head>
<body>
<script src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
});
</script>
<div id="div1"></div>
</body>
</html>
As you see I'm using a local jQuery file (jquery.js
) so every time I write jQuery code it doesn't work knowing that both of my page and jquery.js
in same level ..
But when I'm using a jQuery file online, like this for example
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
everything works fine..
Also I tried to put <script></script>
in the <head>
but nothing works
P.s. I downloaded the same file I'm using online and using it locally.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…