HTML and CSS Reference
In-Depth Information
The browser then takes the header and maps it to the action of parsing the document as
HTML. In some older browsers, the mapping between MIME type or file extension and
browser action is obvious:
This Preferences dialog box shows that the extension or header is what triggers the action
by the browser. The goal here is simply to illustrate that there is something different going
on between reading locally and remotely.
Before wrapping up this brief introductory example, it should be noted that in some
cases when you have configured the wrong file extension or MIME type, some browsers may
“sniff out” the content type and parse any HTML found within. For example, in Figure 1-2
you can see that many versions of Internet Explorer 2 render a file with a .txt extension as
HTML while Firefox does not. We have to pay attention to details even in the simplest
examples if we want to avoid headaches from questionable browser practices and plain old
bugs. HTML5 will aim to remove such problems in the distant future, but for now let's get
down to the most important details, starting first by enumerating all of the versions of
(X)HTML that we might need to know about.
2 Internet Explorer 8 introduces some changes to avoid sniffing; you can set X-Content-Type-Options:
nosniff as a response header to disable Internet Explorer's permissive behavior, though this only works
in IE8 and beyond.
Search WWH ::

Custom Search