page opens in IE7 document mode instead of IE9 - javascript

I know many variations of this question have been asked here but so far no solutions I have tried work for me.
I would like my web app to open in IE9 document mode in IE. When I open the page now, it always opens in 'Internet Explorer7 Standards), while 'Internet Explorer9 standards' is listed as the page default.
I have tried several variations of tagss, including
<meta http-equiv="X-UA-Compatible" value="IE=Edge">
and
<meta http-equiv="X-UA-Compatible" content="IE=7,IE=9">
(both right after the head tag)
I have also tried conditional statements, such as this example from S.O.:
<!--[if IE 7 ]> <body class="ie7> <![endif]-->
<!--[if IE 8 ]> <body class="ie8> <![endif]-->
<!--[if gt IE 8]><!--><body><!--<![endif]-->
Currently I am using: <!DOCTYPE html>
Of course I can manually switch the mode in F12, but I would like to site to open directly in IE9 Document mode (the Compatibility mode always defaults to IE9 Compatibility mode).
Currently I am working on an intranet development server; I have read that this may be a factor? But I would really prefer any solutions to be client-side, that I can add to the JS/HTML.....

Developer Tools Manually Overriding the Document Mode
If Internet Explorer 9 Standards is listed as the Page Default, this means you may have manually changed it to Internet Explorer 7 Standards via the tools. Just switch it back to Internet Explorer 9 Standards in the F12 Developer Tools themselves.
The tools will remember your explicit request to show the page in another Document Mode, and as such not revert to the page default. Consider the following from MSDN:
When you first load a webpage, F12 tools determines the default Document Mode and selects the appropriate mode. The text Page default in parentheses indicates the default mode of the webpage. A check mark appears next to the current mode of the document. Changing the mode causes the webpage to refresh, and remains in this mode until another mode is chosen or the browser is closed.
— Navigating the F12 Developer Tools Interface (emphasis in original)
If you'd like confirm this answer, open up a new browser window and navigate to http://stackoverflow.com. You should note in the F12 Developer Tools that it loads with a Document Mode of "Standards" (IE9 Standards if you're in IE9).
Switch Stack Overflow's Document Mode to IE7 Standards and refresh the browser. After refreshing you'll find that the browser stays with Document Mode: Internet Explorer 7 Standards, and lists Internet Explorer 9 Standards as (Page Default).
Compatibility View Settings
According to the MSDN resource How Internet Explorer Chooses Between Document Modes, the only other potential cause for this would be Compatibility View Settings.
In Internet Explorer 9, click Tools, then Compatibility View Settings. You can find your settings for Intranet sites there. In Internet Explorer 10 (Desktop Mode), you may have to press Alt to reveal the Tools menu item.

Just put following code and your IE browser would open by default in defined compatible view.
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9">
You can change "IE=EmulateIE9" to "IE=EmulateIE8" if you want make IE8 as default compatibility view.
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8">

The issue in my case was that a group policy had been applied on my company-issued laptop which explicitly set the domain that I was using to render in Compatibility Mode. I found this by checking the IE console (F12):
And I verified this by running the following command on my machine, which generated a report of applied group policies on my machine:
gpresult /h C:\gpresult.html
The report had a section like this, which included the root domain of the website I was working on:

You can put the following code sample too.
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
This will load your application in the default browser mode. And specially make sure to include this meta tag as the first tag just after the head tag. Other wise it will not work.

Related

How to set IE 11 enterprise mode to standard mode using javascript or PHP?

I tried a lot for Ckeditor not working when I changed IE 11 standard to Enterprise mode.
I have set below in header for document mode but it does not seems:
<meta http-equiv="X-UA-Compatible" content="IE=8">
So I have substituted idea to turn off the enterprise mode while the page being load but i did not get any javascript code to turn off mode while page load.
Please suggest if any idea to turn off Enterprise mode using java script it would be great helpful.
I used TinyMCE editor instead of Ckeditor it has been worked fine.
Then i could used the meta header below tag:
<meta http-equiv="X-UA-Compatible" content="IE=8,IE=9,IE=7">
Still the TinyMCE completable with All IE browser.

Images not loading on IE10, 9 and 8 .load bug

We are building a website for a client but cant seem to find the bug which causes the images under the slider not to load.
There are some posts going around about the .load function not properly working in IE.
Does anyone have an idea?
http://mbx.web-flight.nl/
Greatly appreciated.
You're problem is Internet Explorer Quirks Mode. You must define a page header in such a way that IE will load the site in standards mode. Switch IE to standards mode manually and you will see the images load.
Try the following on the page to declare DOCTYPE.
<!DOCTYPE html>
Or try to Force IE to use the latest render mode
<meta http-equiv="X-UA-Compatible" content="IE=edge">
Learn more about Quirks mode here: http://en.wikipedia.org/wiki/Quirks_mode
Ultimately the BEST solution is to address the problem at the server level if you have access to do so. See http://msdn.microsoft.com/en-us/library/jj676913%28v=vs.85%29.aspx To learn about configuring web servers to specify document modes.
This is what I see. Does anyone see the same as me. If not, I wonder if it is related to Quirks mode.
On IE 10 for me works fine, but in the IE 9 and lower not works.
This could be happens because the IE 9 don't have some elements of HTML5.
I think that you put this in your file will woks.
<!--[if lt IE 9]>
<script src="js/html5shiv.js"></script>
<script src="js/respond.min.js"></script>
<![endif]-->
Made a test.
I hope help you.
Link for downloads files
https://code.google.com/p/html5shiv/
After allot of searching the bug had to do with the imagesLoaded function which was being used which is part of:
http://isotope.metafizzy.co/
IE does not seem to play nice with it so I made the carousel to initialize on window’s load event (jQuery(window).load) instead of “imagesLoaded”.

Google Maps API V3 pinch-to-zoom does not work with IE 11 on Windows 8.1 preview

Trying to use pinch-to-zoom on multitouch screen with Windows 8.1 preview and Internet Explorer 11 (IE later on) does not work with Google Maps API V3 (none of the latest versions: 3.12, 3.13 and 3.14). The expected behaviour is map zooming in and out.
The same feature is working just fine with Windows 8 and IE 10.
There seem to be two exceptions for the case:
https://maps.google.com
https://developers.google.com/maps/documentation/javascript/examples/map-simple (any example being embedded in the docs pages; when viewed in a standalone tab or window by pressing the view "full screen" pinch-to-zoom does not work)
Does anyone know how that is achieved so that it could be used until the issue is fixed?
For the time being you can add this meta tag to your head tag (make sure it's the first tag after the head)
<meta http-equiv="X-UA-Compatible" content="IE=10" />
That will fix the problem for IE 11 users because the browser will behave as an IE 10 browser.
When Google fixes the bug you can put it back to IE=edge or just remove it.
EDIT : The bug has been fixed by now

Tryied window.open with Ajax, window.print not working (IE9)

I'm trying to open new window and send form data with javascript and jquery-1.8.3.
With Bernhard's help I succeeded to call a new window with page for print.
(Thank you so much Bernhard. window.open and sending form data not working)
But, window.print() function does not working in IE9! (FF, Chorme do well)
I refreshed the page, then IE9 calls window.print()
Here is source code.
Print this
<script type="text/javascript" src="/common/js/jquery-1.8.3.min.js"></script>
<script type="text/javascript">
function printPage(){
$.post('/common/print.jsp', {view:$("#ctn").html()}).success(function(response){
var oWindow = window.open('', "printWindow", "width=700px,height=800px");
oWindow.document.write(response);
oWindow.print(); // I added this line. But IE9 not working.
});
}
</script>
Is there something I missed?
Try this one:
$.post('/common/print.jsp', {view:$("#ctn").html()}).success(function(response){
var oWindow = window.open('', "printWindow", "width=700px,height=800px");
oWindow.document.write(response);
oWindow.document.close();
oWindow.focus();
oWindow.print(); // I added this line. But IE9 not working.
});
checkout this:
Using HTTP Headers to Force Standards View in Internet Explorer 8 and Above
You can also use meta tags to force standards mode. The X-UA-Compatible meta tag tells Internet Explorer what view mode to use or emulate.
By setting this meta tag, you tell IE to use standards mode even if there are comments or an XML declaration above the DOCTYPE. You determine what version of Internet Explorer can best view the page, and then set the meta tags to define that version.
IE 7:
<meta http-equiv="X-UA-Compatible" value="IE=7">
IE 8:
<meta http-equiv="X-UA-Compatible" value="IE=8">
IE 9:
<meta http-equiv="X-UA-Compatible" value="IE=9">
If a customer comes to a page with a view mode higher than it supports
(e.g. an IE 7 browser viewing a page asking for IE8 view mode), it
will ignore the tag and render the page the the mode it would have
without the tag.
More info find here: http://webdesign.about.com/od/internetexplorer/qt/force-compatibility-view-in-ie.htm

Force only part of a page into IE7 compatibility mode

I know you can force a whole page in IE8 or IE9 to render in IE7 mode by adding the meta tag
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
But how can I make it so only part of the page gets rendered in this compatibility mode? I don't want to use iframes.
Unfortunately, you can't. But if you have access to the page, why can't you make it entirely compatible with all versions of IE?

Categories

Resources