Need to force IE11 to IE7 using X-UA-Compatible - javascript

When I kept the tag meta tag 'meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"' in header tag of my jsp, but jsp is in under nested of another jsp like showed in the image.
But i cannot kept in the above jsp, because it's controlled by some other team.
I need to force the Internet explorer to IE7 could someone help me to this without change in system properties

This appears to be impossible as of IE9 - from How Internet Explorer Chooses Between Document Modes (emphasis added):
In Internet Explorer 9, if the document is hosted in an iframe element, the document mode is determined by the document mode of the
top-level webpage. Subdocuments cannot be rendered in IE9 mode unless
the top-level document is also in IE9 mode.
I would assume this rule also applies to framesets - and different document modes - as in your case.
For a more recent look at how IE11 decides which document mode to render in, take a look at Deprecated document modes and Internet Explorer 11, which contains a flowchart of the process.

Related

IE 11 document mode for iframe page when parent page is running in edge mode

Problem - We are trying to migrate our application to use IE Edge mode (we are using IE 11 browser). Our application consists of a top level page and a child iframe to load third party applications (which may load from a domain which is different from parent page domain). As part of migration, parent level page now loads in Edge mode (using IE=Edge value for X-UA-Compatible meta tag)
Question - Can i be absolutely sure that iframe page will always render in Edge mode as well (irrespective of its malformed content or the use of X-UA-Compatible meta tag with a different content value)? Is there any official msdn document confirming the same?
Note:
I checked this msdn link, but it mainly explains IE9 behavior, and it also talks about the case where an iframe cannot have document mode higher than that of parent page.
Based on my understanding, the accepted answer to this question seems to indicate that iframe will also render in Edge mode, but i am not entirely sure.
Any help is appreciated! Thank you.
As from https://msdn.microsoft.com/en-us/library/jj676915%28v=vs.85%29.aspx :
As of IE9 mode, webpages cannot display multiple document modes. For
example, consider a standards-based webpage that contains a frame
element that displays content in quirks mode. IE9 mode displays the
child frame in standards mode (because the parent document is in
standards mode). Starting with Internet Explorer 10, however, child
frames can emulate quirks mode. For more info, see IEBlog: HTML5
Quirks mode in IE10. For best results, however, use document modes
consistently.
This means that If you set the X-UA-Compatible meta tag, if IE version is newer than 9 it will display the current window and all child browsing contexts in Edge mode. If the IE version is 8 (the version in which this meta tag is introduced), this can render child contexts using different rendering mode.

IE11 quirks mode under Iframe - javascript errors

I am reading and looking for answer for days and couldn't found one, hopefully this thread will bring salvation :)
In my company we have a web app that is working on IE8.
We are trying to migrate to IE11.
We almost there but,
We have an old module that is written in an old framework that is hosted in an iframe and running in quirks mode(define with meta http-equiv="X-UA-Compatible" content="IE=emulate7" or IE=5, I tried both).
As long as the parent/main window is rendered in IE8 document mode (via x-ua-compatible meta tag) or in enterprise mode, the iframe works fine.
But as soon as I change the parent/main window to IE=9 and above, I get javascript errors from the child iframe (more than I can handle).
I understand that IE11 uses emulator for quirks mode and not the real engine, but I can not find anywhere details about the javascript engine.
Does this mean that if the parent main window is rendered is IE9 and above, the child iframe will use ECMAscript 5 and not jscript as it should?
is there any solution to my problem?
thanks guys!
Starting with IE10, the child mode can be different from the parent.
See this link. It says...
IE9 mode displays the child frame in standards mode (because the
parent document is in standards mode). Starting with Internet Explorer
10, however, child frames can emulate quirks mode. For more info, see
IEBlog: HTML5 Quirks mode in IE10. For best results, however, use
document modes consistently.
Starting with IE9, frames were limited to the document of the parent document, e.g. if the parent document rendered in standards mode, child frames were forced to render likewise.
Perhaps one approach would be to revise things so that your IE9+ window presents links to open your legacy app in a new parent window, one that presents whatever document mode your child frame requires.
You can use showModelessWindow to open a child window containing a separate HTML file, one that initiates the correct document mode in the parent document...and then loads the IFRAME you're working with. Example code:
var sOptions = "scroll: no; status: no; resizable: yes;";
window.showModelessDialog("myFrameContainer.html", "", sOptions );

Setting IE9 to edge mode without X-UA-Compatible (d3.js)

I'm developing a data visualization page for an intranet using d3.js. The page needs to render in Internet Explorer, which causes trouble since all the intranet pages are rendered in quirks mode. This makes IE throw an error when loading d3: SCRIPT5009: CSSStyleDeclaration is undefined, which then prevents the rest of d3 from loading.
The page works as intended when rendered by by other modern browsers or by IE9 in standards mode, so I believe quirks mode is the problem.
Other limitations, and things I've tried that don't work:
The page is served by a templating system (IBM Cognos) I don't have control over. Setting <meta http-equiv="X-UA-Compatible" content="IE=edge"> is therefore not an option, since I can't modify the header.
Setting the equivalent tag in the HTTP header is also not possible.
If I add a meta tag to the <body>, the only part of the page I have any control over, IE will ignore it.
IE's F12 tools claims it's in document quirks mode, although the browser itself is in IE9 compatibility mode. Changing the document mode manually causes the intranet site to reload the page and navigate back to the parent page. I have no idea why.
Unchecking "Display intranet sites in Compatibility View" in the compatility view settings does nothing.
At the moment I can think of two ways to solve this: either force IE to render in standards mode, or somehow rewrite d3.js so as to avoid using CSSStyleDeclaration, which causes the crash in the first place. I have no idea how to proceed for either of these.

Can an iframe content be rendered in Quirks mode when the parent is rendered in Standards mode? [duplicate]

We have a parent page that must run in IE9 standard mode, executing HTML5 commands.
Underneath we have an iframe that must run in compatibility mode (IE7/8).
In IE9, as I understand, iframes inherits their doctype from parent. is that correct?
Is there any solution for this issue? can , somehow, iframe be executed with quirks doctype under standard mode doctype parent frame?
thanks,
Tal
It's not possible to trigger a different rendering mode in a child iframe in IE9, as officially documented here: http://msdn.microsoft.com/en-us/library/gg558056(v=vs.85).aspx (emphasis added):
Although the newer rendering engine is only used when Windows Internet
Explorer detects that an HTML page has requested the highest level of
support for standards, the same is not always true for child pages
that might be loaded within frame and iframe elements. Because only
one rendering engine can be active at a time, IE9 Mode also includes
emulation for Quirks Mode.
However, as it says, you can trigger "quirks mode emulation" which leaves the IE9 rendering engine active but alters its behavior in several ways to match the old quirks mode.
JSBin demo: http://jsbin.com/ozejuk/1/
This example has a div with style background: #ff0000; background: 00ff00; border-radius: 30px ... in quirks mode, hex colors without # are accepted. In IE9 mode they are not. Loading the demo in IE9 will show a red div in the parent page, and a green div (but still with rounded corners) in the iframe.
How to trigger quirks mode emulation in an iframe: http://msdn.microsoft.com/en-us/library/gg558096(v=vs.85).aspx
Short version: omit DOCTYPE, add: <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
Complete list of effects quirks mode emulation has on rendering: http://msdn.microsoft.com/en-us/library/gg558047(v=vs.85).aspx

IE8 does not support querySelectorAll

I tried to use document.querySelectorAll(), but IE8 throw error, that
Object doesn't support this property or method
var titleCheckBox = document.querySelectorAll("");
Here http://www.quirksmode.org/dom/w3c_core.html#t13 written, that IE8 support this method.
What I doing wrong?
Check that your page isn't in Quirks mode or Compatibility mode. You can use the F12 dev tools to confirm this. Press F12 and look in the top-right corner of the resulting window. If you see "Compatibility" or "Quirks" in the mode description, then you've found the problem.
Quirks mode: this is usually triggered by a missing or broken Doctype. If this is the case, make sure your page starts with the following:
<!DOCTYPE html>
Compatibility mode (IE7 mode): This may be triggered if you're viewing the page locally (ie running it on your local machine, eg for testing, or on your local network). In this case, you are being hit by an IE config setting that you should disable. Go to the Tools menu, and pick the Comaptibility View Settings option. Untick the compatibility options, and the page should start working.
Compat mode may also be triggered (or avoided) by an X-UA-Compatibility meta tag. If you're having trouble with compatibility mode, this is a good way to avoid it: Add the following line to your code:
<meta http-equiv="X-UA-Compatible" content="IE=edge">
Either (or both) of the above could be the problem, but my guess is that the problem is compatibility mode. The compat-mode-on-intranet-sites setting is suprisingly little known, and catches a lot of people out, even some seasoned developers.
IE8 only supports querySelectorAll() in standards mode. From MSDN:
The Selectors API is defined as part of the Selectors API specification and is only available to Web pages displayed in IE8 standards mode.
Chances are your page doesn't have a proper DOCTYPE declaration; you will need to add one.

Categories

Resources