1

I want to detect whether a doctype exists for the current document and add one if nothing exists.

I'm able to check whether a doctype exists using document.doctype. But how can i add one?

6
  • bad idea. I believe it is read only. Commented Aug 26, 2010 at 9:01
  • Oh my. In IE 7 and IE 8 if no doctype is specified it is running in Quirks mode. So position:fixed is not working. Hence i want to add a doctype dynamically. Commented Aug 26, 2010 at 9:15
  • I'd be very surprised if it's possible to get the page to change modes once it's loaded. Commented Aug 26, 2010 at 9:38
  • is there any other possibility by which i can tell the browser not to run in quirks mode? Commented Aug 26, 2010 at 11:05
  • 1
    At runtime, the browser would have already made up his mind. So you can't change the render mode during render. Makes sense, yes? Commented Aug 26, 2010 at 12:44

1 Answer 1

3

I don't think it's possible to change the page mode from within the page. Sorry.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.