T. R. Valentine wrote:
On 03/12/05, Christian Montoya <[EMAIL PROTECTED]> wrote:

If your server is sending the MIME type text/html, then the META
doesn't do anything. You need to change the MIME type being sent out
in the headers, and that is done server side.

The only reason the meta element contains text/html, is so that it conforms with the syntax of an HTTP header. Since at least the Content-Type needs to be sent with the HTTP headers (or other higher level protocol), the MIME type specified in the meta element is essentially meaningless.

Theoretically, the meta element is supposed to be able to be read by a server prior to sending the file to determine the HTTP headers to be sent, but I don't believe any servers in existence, or at least in use, actually do so.

Browsers will try to determine the encoding from the meta element, if it's not specified in the HTTP headers, but the HTTP headers must always take precedence.

Thanks for that explanation. But what about when simply opening the
.html file in a browser, no server involved? Even there I do not see a
difference in IE between the two forms.

When opening from the local file system, browsers typically using the file extension to determine the MIME type. .html is generally associated with text/html, and that is the MIME type used.

This is a summary of file extensions and their commonly associated MIME types:
.xml         application/xml (preferred) or text/xml (not recommended)
.xht .xhtml  application/xhtml+xml
.htm .html   text/html

If you create some files with these extensions and open them up in Firefox. Then go to Tools > Page Info, and notice where it says 'Type:' followed by the MIME type used. This info is also available in Opera and possibly other browsers too, I just can't remember where to find it.

If you create an ill-formed XHTML document, save it as two separate files: one with .html and the other with .xhtml, and open the up in IE and Firefox. The results will be something like this:

.html  opens normally in any browser
.xhtml
Firefox will report well-formedness errors, page info dialog will typically show application/xhtml+xml. IE will either offer a save as dialog or cause it to open in your default browser (it opens it with Firefox for me, because that's my default browser, your system may be different)



--
Lachlan Hunt
http://lachy.id.au/
******************************************************
The discussion list for  http://webstandardsgroup.org/

See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************

Reply via email to