3

Any idea why this is not generating an html5 doctype in my pages?

<apex:page applyBodyTag="false" applyHtmlTag="false" showHeader="false" cache="false" contentType="text/html" sidebar="false" standardStylesheets="false" docType="html-5.0">

API version is set to 36.0

When I open the console in IE11, I get this warning message: HTML1527: DOCTYPE expected. Consider adding a valid HTML5 doctype: "".

Also, when I view the page's source in Chrome, Firefox, and IE11, I do not see a tag included in the markup.

  • 2
    what is your vf page api version? It has to be above API version 28.0! – codeyinthecloud Jan 4 at 17:54
  • 1
    Can you share us your findings on how did you identify that page is not generating Html5 doctype? – codeyinthecloud Jan 4 at 18:15
  • Please edit your post with any clarifications. – Adrian Larson Jan 4 at 18:22
3

Adding a "custom" contentType appears to suppress the DOCTYPE. Do not add this attribute if you need the DOCTYPE.

<apex:page applyBodyTag="false" applyHtmlTag="false" 
           showHeader="false" cache="false" sidebar="false"
           standardStylesheets="false" docType="html-5.0">

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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