Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
542 views
in Technique[技术] by (71.8m points)

jquery - jqGrid and Compatibility View mode in IE8

In my last project I've used jqGrid 3.8.2, jQuery 1.4.4 and jquery-ui-1.8.10. The company I work for still uses IE8 as a web broswer so in my development I always test with that platform. I've noticed today that a jqGrid is rendered properly when I test everything on my machine (winXP) using the Visual Studio (2010) ASP.NET Development Server: Good

As you can see the selection is perfect and the header is ok.

When I copy everything on the production server (Win 2003 + IIS6.0) the same form renders in a funny way.

Bad

As you can see now the row selection is not working properly and I've got these strange arrows in the header. PS: I am using the same computer and browser to render the same page. PPS: Obviously, if I use a different (professional ;-) ) browser (mozilla, safari, opera, chrome) everything works properly.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

For some strange reason IE8 sets the "compatibility view" for all the intranet sites: Compantibility View Settings

So I couldn't see the "compatibility view" button next to my URL bar.
I had to go to Tools - Compantibility View Settings and uncheck the flag "Display intranet sites in Compatibility View".
No my site (intranet site) is shown in standard mode and everything works as expected.
Thanks Microsoft cause, once again, I've wasted a few hours for your silliness.

UPDATE

As Oleg suggested you can add these tags to your configuration file (ASP.NET and MVC):

<system.webServer>
      <httpProtocol>
      <customHeaders>
        <clear />
        <add name="X-UA-Compatible" value="IE=8" />
      </customHeaders>
    </httpProtocol>
    ...
</system.webServer>

but this only works in IIS7 cause <system.webServer> is not used by IIS6.
A better way to achieve the same results - and it works for me - is to put a META tag in the master page in the HEAD section:

<meta http-equiv="X-UA-Compatible" content="IE=8" />

I've tested it and it works even if you have "Display intranet sites in Compatibility View" active.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...