Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes HTML, CSS and JavaScript and the fly likes IE 8 compatibility Issue Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "IE 8 compatibility Issue" Watch "IE 8 compatibility Issue" New topic
Author

IE 8 compatibility Issue

Paranidharan Selvaraj
Greenhorn

Joined: Mar 19, 2010
Posts: 17
We are recently switched to IE8. There are compatibility issues, so we included the meta tag,
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" > and we modified css files.. It is working now. We need to work out the solution for the future release of IE also. Is there any specific way of doing it?
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15357
    
    6
There is no magic way.
Code to standards and adjust the CSS.

Notes on major changes: http://msdn.microsoft.com/en-us/library/cc304082%28v=vs.85%29.aspx

Eric
Paranidharan Selvaraj
Greenhorn

Joined: Mar 19, 2010
Posts: 17
My issue has been setting the meta tag content depending on the version of IE 6, 7, 8, and later version.

if(navigator.appName == "Microsoft Internet Explorer"){
var meta = document.createElement('meta');
meta.setAttribute('http-equiv', 'X-UA-Compatible');
meta.setAttribute('content', 'IE=EmulateIE'+getIEVersionNumber());
document.getElementsByTagName('head')[0].appendChild(meta);
}

function getIEVersionNumber() {
if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ //test for MSIE x.x;
var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number
return ieversion;
}
}

The meta tag appended has no effects. Can anyone suggest handling X-UA-Compatible for future releases.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15357
    
    6
Meta tag has to be on the page BEFORE the page is rendered. Hence adding it as the page is loading will do nothing.

Eric
Paranidharan Selvaraj
Greenhorn

Joined: Mar 19, 2010
Posts: 17
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />

I am using this meta tag for IE8 compatibilty... Again if my client migrates to IE9 and i have to keep changing this.. Instead i like to code for all the versions.

Is it feasible?

 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: IE 8 compatibility Issue
 
Similar Threads
IE & Netscape support info
java script comptibility in firefox 1.5
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> does not work in IE9
Should Java 7/8 be backwards compatible?
Browser Compatibility