I'm developing an intranet site using MVC3, and IIS 7.5 is configured to do Windows Authentication.
On my local machine, during developement, both chrome and IE9 execute the javascript without any problems.
When I deploy the solution to my test server, and access it with http://dev-server-name/Home IE does not run any of the javascript. The default mode is apparently Compatibility Mode. Accessing the same URL with chrome runs the javascript just fine. (I am testing a POST where I have required fields, using unobtrusive validation).
I checked the server logs, and IE is loading the appropriate javascript libraries - every script request has a 200 code.
If I switch the browser mode in the dev tool from IE9 Compat View (IE7 standards) to IE9 Standards, then it works.
When deployed, clients will be accessing the site with a mix of IE8 and IE9. How can I get the javascript to run regardless of the IE browser mode?
It seems like another team hosting application on the server has requested the compatibility mode on the client browser. Since the list is by site (domain) your application is also running in the same mode. Add a meta tag in the page
<meta http-equiv="X-UA-Compatible" content="IE=edge" >
or
<meta http-equiv="X-UA-Compatible" content="IE=9" >
and see if that makes any difference. Make sure that this is before any stylesheets are included. Put this as a fist element in the head.