Information Security Stack Exchange is a question and answer site for information security professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm considering using modern techniques to protect my Javascript code and am studying how the DOCTYPE element selection may impact that. Specifically, the linked question used IFrames which are not permitted in certain selections of DOCTYPE.

In taking a broader view of this question, not specifically linked to the IFrame protection, are there any other considerations to take into account when choosing a DOCTYPE for my site?

share|improve this question
Possibly related:… – Adi Mar 28 '13 at 17:49
Since DOCTYPE is a layout engine selector, I don't see this as a potential security but merely a compatibility concern. That said, it would be a good practice to only use AJAX relevant parts of your code on user agents that are compliant with a selected DOCTYPE and serve others a non-AJAX version. – TildalWave Mar 28 '13 at 18:12

Document types (or DOCTYPE) is a declarative and semantical element which is part of the W3C specification regarding markup languages documents (such as XHTML).

Their presence (or non-presence) within a markup document does not influence a whatever security aspect when they are being rendered and processed by a web browser.

If you are writing an XHTML 1.1 document, there is a DOCTYPE for it, same if you are writing an HTML5 document.

We say that these elements are essentially semantical rather than functional.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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