views:

944

answers:

3

I need to force IE8 to display as follows:

  1. Browser Mode: Internet Explorer 8

  2. Document Mode: IE8 Standards

I have added this tag however it only affects the document mode, not the browser mode. How do I override browser mode to ensure the page is always shown with IE8 browser mode too?

<meta http-equiv="X-UA-Compatible" content="IE=8" />
+1  A: 

As I understand it, the meta element you've posted tells the browser to use IE8 mode.

Using a strict doctype, e.g. <!DOCTYPE html> or <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt; will tell the browser to render in standards mode.

A combination of the two will render the page in IE8 Standards mode.

Olly Hodgson
Im using strict doctype already
cfdev9
Is the X-UA-Compatible metatag the first item after the <title> element? It needs to be very near the top of the <head> to have any effect.
Olly Hodgson
Also, have a look at the options under Tools > Compatibility View Settings, make sure it's not running all "intranet" websites in compatibility mode.
Olly Hodgson
It is running all intranet websites in compatibility mode, that's a default group policy setting for all PCs on the network. Also yes the meta tag is just below the title element.
cfdev9
+2  A: 

Just give the HTML page the right doctype. E.g.

<!doctype html>

For an explanation and overview of all doctypes see http://hsivonen.iki.fi/doctype/. You don't necessarily need those (nasty) meta headers.

BalusC
the doctype is ok, it's ie8 standards... the browser mode is wrong
cfdev9
Then the problem lies somewhere else. You need to elaborate more about it. What problem do you exactly have for which you think to solve with setting the "browser mode"? Please edit your question accordingly.
BalusC
My website works fine in standards compliant browsers (tested ok in chrome, firefox, opera) but IE is a nightmare. Because the web application is javascript intensive we're not supporting IE7 and have developed it for IE8 standards mode, so I need it only to display in IE8 standards mode.
cfdev9
The strict doctype should already display IE6/7/8 in standards mode. Your problem lies somewhere else. Concentrate on the Javascript corner. Post a the question in the Javascript context, not in the webbrowser context.
BalusC
A: 

It's impossible because the browser mode is determined before sending the request.

emk