views:

208

answers:

4

Hi, on my master page, I have referenced jquery file. I am doing simple hover function. When mouse hover, I change the css and when hover out, change the css back to originial. Nothing fancy. but my page throws jquery error when I run in IIS6 on server 2003. When I run on IIS5.1 on local xp machine, it works perfectly fine. Any idea? I access both pages from my machine so IE settings is not the problem. I opened the both js file and the error line is nothing but the end of the file ( i.e last line of the js file)

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; OfficeLiveConnector.1.4; OfficeLivePatch.1.3) Timestamp: Mon, 5 Apr 2010 21:59:18 UTC

Message: Syntax error Line: 4377 Char: 2 Code: 0 URI: server-test/myapplication/Scripts/jquery-1.3.2.js (removed the link because stackoverflow does not allow me to put more than one link)

Message: Syntax error Line: 6183 Char: 2 Code: 0 URI: server-test/myapplication/Scripts/jquery-1.3.2-vsdoc.js (removed the link because stackoverflow does not allow me to put more than one link)

Message: Object expected Line: 189 Char: 9 Code: 0 URI: http://server-test/myapplication/

+1  A: 

Are your paths still correct on your remote machine (IIS 6)? I would start there and make sure that you are referencing the files correctly.

Tommy
A: 

Have you tried testing in Firefox with the Firebug addon? That helps me to track down some errors. Also, which IE are you using? IE8 has the Web Developers extensions that are like Firebug.

drachenstern
+1  A: 

Put this in your master page

<asp:ScriptManager ID="ScriptManager1" runat="server">
      <Scripts>
          <asp:ScriptReference Path="jquery/jquery-1.3.2.js" ScriptMode="Release" />
      </Scripts>
  </asp:ScriptManager>

Write your block at the bottom of the aspx you want it. and make sure the whole things is wrapped within

$(function(){
     // the other stuff
});

the character "~" refers to the root folder of your sln. so go for the path like ~/scripts/jquery/....

XGreen
A few things here, the block location doesn't matter when using the `document.ready` event, and `~/` refers to the *application* root, not the solution root, major difference there. Also, for **Release** you want the min file, Debug the uncompressed version.
Nick Craver
+1  A: 

I figured out the problem. It has nothing to do with jquery but it's the stupid IIS server. I was wondering why it works for IIS5 and not for IIS6 and the culprit behind this is document footer option of IIS. I had document footer enabled for iis6 on server. I am sure most of you know this but for people who don't know this: if document footer is enabled for iis, it adds extra html content at the end of the static files i.e .htm or .js file but not .aspx file because it's not considered as static. so I disabled the document footer section and clear all cache from ie and it started working fine. thanks all for your help.

shahk26