问题
I have a website that works in full compatibility on All browsers including IE 7 to 9
I was shocked when i tried it on IE-10, Too many bugs, and because I have no time to fix this for IE-10 and i am also using third party controls "Telerik", I decided to try a simple solution by turning the Document and the browser mode back to ie9.
In Developer Tools for IE-10, If i set Manually The Document Mode to IE9 Standards and the Browser Mode to IE9, All the bugs will fly away, I have found a way that forcing the IE-10 to use the Document Mode :
<meta http-equiv="X-UA-Compatible" content="IE=9" />
But what about the Browser Mode? is there any way to set its value before rendering?
Solution : The way i used in this question was correct, however the solution for me was updating the windows in the hosting server, There was many updates, suspected one is: Update for Internet Explorer 8 Compatibility View List for Windows Server 2008 R2 x64 Edition (KB2598845)
回答1:
You've already got the document mode sorted. Does that not solve the problem? It usually does the trick.
The browser mode shouldn't need to come into play, as it doesn't affect the rendering at all; it just changes the UA string, so it shouldn't have any impact on the page layout.... unless there is something in the code that tries to do a browser-specific hack by looking at the UA string.
If you have got something in your code that does that, then that's where the problem is and you should probably fix it. (using the UA string to affect page layout is generally frowned on as a bad practice anyway; there are usually better ways to do it)
If it's Telerik itself that's doing it, then I would imagine they'd have already been forced to find a fix for it (IE10 has been out for a while and they'd have had other users complaining), so you may find that updating to the latest version will solve the problem.
来源:https://stackoverflow.com/questions/15636939/fixing-the-browser-mode-in-ie-programmatically