I have the following Jquery functionality which works in my local machine using visual studio 2010.
When I deploy the asp.net web application to iis, the website loads but all the jwuery functionality doesn’t work. I have the following reference in my aspx file
justin9
Member
67 Points
123 Posts
Unable to load Jquery files in IIS
Mar 01, 2012 03:44 PM|LINK
Hi,
I have the following Jquery functionality which works in my local machine using visual studio 2010.
When I deploy the asp.net web application to iis, the website loads but all the jwuery functionality doesn’t work. I have the following reference in my aspx file
<script type="text/javascript" src="../Scripts/jquery/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="../Scripts/jquery/jquery.autocomplete.js"></script>
<script type="text/javascript" src="../Scripts/jquery/jquery.validate.js"></script>
<script type="text/javascript" src="../Scripts/jquery/jquery.maskedinput.js"></script>
<script type="text/javascript" src="../Scripts/Util.js"></script>
Can you please let me know what im doing wrong here.
Im using iis 7.5
Do I need to configure anything additional for this
Thanks
Justin
Wozer
Member
390 Points
266 Posts
Re: Unable to load Jquery files in IIS
Mar 01, 2012 03:50 PM|LINK
What happens if you load Jquery using Google API hosting:
Ramesh T
Contributor
5081 Points
822 Posts
Re: Unable to load Jquery files in IIS
Mar 01, 2012 03:51 PM|LINK
Did u check whether the MIME type 'application/x-javascript' (set against file name extesion '.js') is present in IIS?
Add if its not present and try again.
justin9
Member
67 Points
123 Posts
Re: Unable to load Jquery files in IIS
Mar 01, 2012 04:00 PM|LINK
Hi I just checked the MIMe type and the application/x-javascript is set to the entension of .js.
should i check for anything else. im kinda new to jquery.
also how do i reference to the google apis....?
Wozer
Member
390 Points
266 Posts
Re: Unable to load Jquery files in IIS
Mar 01, 2012 04:02 PM|LINK
Just put that script in your page instead of what you had
justin9
Member
67 Points
123 Posts
Re: Unable to load Jquery files in IIS
Mar 01, 2012 04:07 PM|LINK
There are multipe scripts and are huge, this would not be an option as the code is multi lined in the jquery scripit files.
Wozer
Member
390 Points
266 Posts
Re: Unable to load Jquery files in IIS
Mar 01, 2012 04:11 PM|LINK
replace just the top one with it, the one that loads jquery-1.3.2.min.js
Though I think that the google one includes autocomplete as well, so you should be able to take that one out.
justin9
Member
67 Points
123 Posts
Re: Unable to load Jquery files in IIS
Mar 01, 2012 04:14 PM|LINK
I cannot use the google one as some of the code is written in document .ready function which all would be needed to replace with the google function.
why would ypu think the server is not reading these files. the local machine reads fine and works perfectly.
Wozer
Member
390 Points
266 Posts
Re: Unable to load Jquery files in IIS
Mar 01, 2012 04:17 PM|LINK
Google API still uses Document.ready, it is just a hosting link to the Jquery files.
Have you tried this:
http://stackoverflow.com/questions/2715098/jquerydocument-ready-doesnt-run-under-iis7
Sounds like the same issue you are having.
Edit: Are you using Firebug or Google Chrome? If so does the console show any errors with Jquery?
justin9
Member
67 Points
123 Posts
Re: Unable to load Jquery files in IIS
Mar 01, 2012 04:27 PM|LINK
I tried this but mine is not MVC its simple asp.net application with webforms so url.content is not working in the aspx.page.
I had to use IE as per the project and the eror its showing is that its saying syntax error on line 1 and char 1 in the jquery script file.
but when i check for the same in the file its just commented code.
thanks Wozer for the prompt replies.
if i can reference google api with changing any code how can i do it for my file
<script type="text/javascript" src="../Scripts/jquery/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="../Scripts/jquery/jquery.autocomplete.js"></script>
<script type="text/javascript" src="../Scripts/jquery/jquery.validate.js"></script>
<script type="text/javascript" src="../Scripts/jquery/jquery.maskedinput.js"></script>
<script type="text/javascript" src="../Scripts/Util.js"></script>