How to update website for compatibility with Internet Explorer 9?
when I launched my site within Internet Explorer 9 I began receiving script error messages. I read the support for Internet Explorer and found out that because some sites are designed for older browsers there'll be compatibility issues until the sites are updated for Internet Explorer 9.
I found that I could add this code :
void Application_BeginRequest()
{
Response.AppendHeader("X-UA-Compatible", "IE=EmulateIE8");
}
to the Global.asax file to deal with the iss开发者_如何学Cue. The errors I received were from IE9.
EDIT: The errors were fixed but I want to know if there is an alternative method to making a website compatible with IE9? Also what are the differences between the way IE8 interprets Javascript code and IE9?
What you did is correct. This is one of the server side way to handle this. Alternately, you can set this in HTML header (will be painful as you have to do it for all the pages)
On a related note - read the IE compatibility blog which has more details on this topic:
http://blogs.msdn.com/b/ie/archive/2010/06/16/ie-s-compatibility-features-for-site-developers.aspx
精彩评论