I am working on a ASP.net project created with local file system settings. I am using MVC and Jquery. Jquery is working fine when I run the application in debug mode i.e. in
I got the message by having a mismatch between the version of JavaScript in the page and the version in the project.
On the page: <script src="@Url.Content("~/Scripts/jquery-1.4.4.min.js")" type="text/javascript"></script>
Actual version in the project: jquery-1.4.1.min.js
Diagnosed by using Firebug, and setting it show all errors, as described in the accepted answer.
Common mistakes is that other Jquery Scripts are included first(Jquery.validation.js) before the Jquery.js
One additional reason for this error I found out occurs if you are loading jQuery from a cdn and a local script from your server. They load independently, so if the local script finishing before the jQuery it will also be executed before, which gives us the lovely error. This is especialy an issue if jQuery is not in the browsercache so you might see this error occur on the first time the scripts loads and vanish later.
You could also try letting Google host jQuery for you:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
This will avoid having to worry about the relative path to the script, avoid load on your server, and will be faster for users (who probably already have it in their browser's cache somewhere).
Try using Firebug 'Net' tab to see if the file gets loaded.
You can also configure Firebug to fail on all errors and see when the error happens as compared to when jQuery gets loaded.
Jquery
?!
You mean jQuery
?
Javascript is case-sensitive. Jquery
is not the same as jQuery
.