Log in

View Full Version : How does wordpress do it?



lord_havoc
09-20-2007, 03:01 PM
If IE doesn't support XHTML, then how do they make their themes cross-browser compatible?

Twey
09-20-2007, 04:45 PM
It sends the XHTML with an HTML content type and expects the browser to error-correct it into HTML. This is generally bad practice (see XHTML Considered Harmful (http://www.hixie.ch/advocacy/xhtml) for some current practical reasons, on top of the many potential problems that may arise from and general nastiness of serving content as something other than what it is and the general issues of serving invalid code), and also makes it impossible to use any of the new features of XHTML -- and if you're not using any of those, there's currently very little reason to write XHTML in the first place.

djr33
09-20-2007, 05:41 PM
As an example....

It would be great if there was a tag that would automatically generate cool content. But let's say the <coolcontent> tag isn't supported in IE... or in FF, Opera, etc.
So, since it is promising, you might be tempted to use it.

Try it, and see what happens.

Just insert <coolcontent> into your html. It'll be fun. :p

(If you're lucky, it won't cause any errors, aside from invalidating the page, and would, hypothetically, work in that one browser it is supported in.)

Twey
09-20-2007, 06:31 PM
Bad example. In the case of XHTML, sending it as HTML affects all browsers, so it doesn't work in any of them. You can, e.g., check the Accept header to see if the browser supports XHTML, but due to some dubious design decisions IE claims to support everything (Accept: */*), so if you do it the proper way it won't work. This is irritating because it means that the only way to do it is to check for the explicit "application/xhtml+xml", which is bad because it means that browsers that use wildcards sensibly (e.g. application/*+xml) get the HTML content type -- and of course, you still can't use anything XHTML-specific because it won't work in the browsers that get it as HTML.

djr33
09-20-2007, 06:33 PM
Well, it's worse then :p