14

How to change the Document Mode in Internet Explorer to Standards value by using visual force page coding ? I need it to display the page correctly in IE.

  • Based on some the answers below, can you be more specific as to what the page needs? As Avidev notes, you can set the docType attribute to specify the actual HTML doctype. As jkraybill and Mohith point out - you can set a meta tag which will have some browsers (like IE) behave like a specific version. – joshbirk Mar 5 '13 at 13:43
33

There is a docType attribute in <apex:page> component you can set that to html-5.0

For Example

 <apex:page docType="html-5.0" />
  • I want to change the Document Mode to "Standards" Value in Internet explorer using coding which is not accomplished by above code if you have any work around please suggest me. – user1087 Mar 2 '13 at 10:04
  • This does answer the question as it's phrased, but the solution is as per Jeremy's answer. It might be prudent to update the question to demonstrate why it renders incorrectly in IE. – Matt Lacey Mar 5 '13 at 1:08
4

I think you'll find the answer on this question helpful, it involves setting the X-UA-Compatible header via Apex. IE10 Forced into IE7 Standards document mode for Visualforce

2

http://css.dzone.com/articles/document-compatibility-modes

https://stackoverflow.com/questions/2950598/ie8-browser-mode-vs-document-mode

One alternative is always adding the metatag

<head>
<title>The Page Title</title>
<meta http-equiv="X-UA-Compatible" content="IE=8" />
</head> 
  • No Mohit above code doesn't change the document mode of IE to standards value. – user1087 Mar 2 '13 at 13:07
  • Document Mode is overridden by the compatibility mode in IE.The compatibility mode along with doctype set determines the document mode.You may like to read the stackoverflow.com/questions/2950598/…. my answer explains how to change compactibility mode and Aridev one gives how to set doctype.Using combination of those you must reach to answer – Mohith Shrivastava Mar 2 '13 at 14:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.