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
For me, this error typically occurs when there is a true Javascript error in some of my code. This prevents the jQuery.js file from being fully parsed. Look in the Error Console in Firebug, Safari or another debugging-friendly browser.
Raja is right, URL.Content works.
<script src="<%= Url.Content("~/Scripts/jquery-1.2.6.js")%>" type="text/javascript"></script>
Further, to prevent yourself from getting surprised at the moment you are migrating your application to an IIS server, don't use web development server but use IIS when developing.
You can use IIS directly from visual studio by editing the the web properties:
After Using the FIrebug, I found out the files were not found as the relative path for the files doesn;t work. TO resolve the problem, we should use the Url.Content Method to reslove the path. For example:
<script src="<%= Url.Content("~/Scripts/jquery-1.2.6.js")%>" type="text/javascript"></script>
This usually occurs when you have malformed HTML or JavaScript.
try
<script src="<%= ResolveUrl("~/Scripts/jquery-1.2.6.js")%>" type="text/javascript"></script>
If all else fails, make sure the file has the right permissions set. This just happened to me!
You can either right click the file in your directory and set the permission there, or just create another .js file in Visual Studio and copy and paste the contents over. Worked like a charm. :)