eonil
eonil

Reputation: 85955

MIME type for HTML5 in strict XML syntax (XHTML5??, for Mobile Safari)?

I have to generate a HTML page for Mobile Safari only. So I have chosen HTML in strict XML syntax. But I don't know how should I set MIME type for this kind of document.

Upvotes: 3

Views: 3637

Answers (1)

alex
alex

Reputation: 490123

You should set the mime as text/html, not application/xml.

The latter will put your browser in an unforgiving parsing mode, where any malformed syntax will cause the page to completely error.

Why does this matter? You may have a CMS or something external that accidentally places some invalid XML on your page; would you rather your site not be visible to anyone or would you rather the browser gracefully recover? I know what I would prefer.

Also, I believe HTML5 should always have the text/html mime type; the syntax you use is optional (self closing tags can have /> or just >).

Upvotes: 3

Related Questions