I am having a trouble using jQuery in my HTML. This might be a very simple issue, but I cant figure it out.
Following is my HTML code:
<html>
<head>
<title>index</title>
<style type="text/css">
</style>
</head>
<body>
<ul>
<li>hello</li>
</ul>
<script src="jquery-1.7.1.js"></script>
</body>
</html>
I am trying to use console in “Web Developer Tool” in Chrome for mac. But as soon as I add script tag in my HTML I get the following error in console.
Cant figure out whats happening. Thanks
UPDATE:
My problem is solved. The jQuery file was corrupt. I will probable use the older version.
I just copied your code in to a new document then downloaded jQuery from here:
http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js
everything worked as expected, I’m assuming there is something wrong with your jQuery source file. Try downloading a fresh copy.