Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# jQuery IE9
Whenever i open my website it opens in Browser Mode : IE8 Compatibility View. I don't want my website to open in compatibility view either 8 or 9.
I need to set a Browser Mode of IE using jquery or C#. Document Mode of IE had been set but Browser mode of IE could not be set using jquery or C#.
 
I don't want Browser Mode of IE to be set manually.
 
Please help me to resolve this problem..
Thanking You in advance.
Posted 29-May-12 21:27pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You could do that by using META Tag. For example,
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" >
 
For more information look at this page Defining Document Compatibility[^]
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

var j = jQuery.noConflict();
j(document).ready(function(){
    /* detect usage of IE Developer Tools using different Mode for Browser and Document */
    if(j.browser.msie) {
        var browserVersion = j.browser.version.slice(0,j.browser.version.indexOf("."));
        var documentVersion = document.documentMode;
        if(browserVersion != documentVersion) {
            alert("ERROR:\nBrowser Mode and Document Mode do not match!\n\nBrowser Mode: IE"+ browserVersion +".0\nDocument Mode: IE"+ documentVersion +".0");
        }
    }
});
  Permalink  
Comments
Naz_Firdouse at 12-Jul-13 3:11am
   
does this sets the browser mode?
chirag.jdk at 22-Jul-13 7:51am
   
it's just for checking purpose
Naz_Firdouse at 22-Jul-13 8:15am
   
then how to set the browser mode?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 341
1 Marcin Kozub 225
2 Sergey Alexandrovich Kryukov 220
3 Praneet Nadkar 197
4 Shweta N Mishra 161
0 OriginalGriff 8,149
1 Sergey Alexandrovich Kryukov 7,287
2 DamithSL 5,614
3 Manas Bhardwaj 4,986
4 Maciej Los 4,910


Advertise | Privacy | Mobile
Web03 | 2.8.1411023.1 | Last Updated 12 Jul 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100