Michael Poxon

Navigation

Skip navigation.

Search

Site navigation

Email conversation

FromMichael Poxon
ToMe
SubjectIE7 wont touch XHTML
Date12 May 2008 13:24
Hi,
I expect you can answer this in about 10 secs!
I wrote a really simple page using an XHTML template:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- Created on: 13/05/2008 -->
<head>
<title></title>
</head>
<body>


</body>
</html>

But IE7 wouldn't even recognise it.

It kept asking if I wanted to open or save the file. Choosing open (and
telling it to use IE to do so, therefore it didn't recognise the file type)
merely produced the same popup dialog.


Help!!

Michael Poxon
FromMe
ToMichael Poxon
SubjectRe: IE7 wont touch XHTML
Date12 May 2008 15:18
Michael,

> But IE7 wouldn't even recognise it.

http://www.howtocreate.co.uk/wrongWithIE/?chapter=XHTML

IE still does not support the correct MIME type for XHTML, or any of the XML
features of XHTML. It only understands HTML. Yes, it is a stupid browser.
Even IE 8 beta does not support XHTML, so it looks like things are not going
to change any time soon.

If you tell your server to serve the page using the text/html MIME type to
browsers that do not understand XHTML, and you use XHTML 1.0 (not XHTML 1.1
which you are currently using) you can then follow the guidelines in the
XHTML 1.0 specification appendix C:
http://www.w3.org/TR/xhtml1/#guidelines

This shows you how to use XHTML that browsers will interpret as HTML if the
server uses the text/html MIME type for those browsers. My article (link
above) shows how to automatically use the best MIME type for a given
browser.


Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
FromMichael Poxon
ToMe
SubjectRe: IE7 wont touch XHTML
Date17 May 2008 18:38
Dear Mark,
Thanks for your quick reply! I see from your workaround that one can use
PHP. But IE7 won't read a PHP page either! The same thing happens - (I
assume that I put the code you provide before the "doctype declaration") -
IE asks me if I want to open or save the file.
Cheers,
Michael.
FromMe
ToMichael Poxon
SubjectRe: IE7 wont touch XHTML
Date18 May 2008 16:56
Michael,

> Thanks for your quick reply! I see from your workaround that one can use
> PHP. But IE7 won't read a PHP page either!

I just realised there was a mistake in the PHP code. I have updated the
page.

However, the mistake means that the page should have only ever sent the
default header, which would have been the one that IE supports. So the fact
that it is not working means that the PHP itself is not working. Make sure
you have named the file something that your host treats as PHP (typically
calling it something.php) and make sure that your host actually supports PHP
- this will not work when loading the file directly off your disk. Your host
must also send the correct default header, and allow you to change it.
Please check these things with your hosting service. They should be able to
help you send the correct headers.

Of course, since you are only using HTML features, you might as well not use
XHTML at all, and just use HTML for everything (unless you are using some
development tool that works best with XHTML where you might actually have a
good reason for using it).

> put the code you provide before the "doctype declaration"

Correct. The PHP must be the very first content on the page. There must not
even be any spaces before the <?php tag.


Tarquin
FromMichael Poxon
ToMe
SubjectRe: IE7 wont touch XHTML
Date18 May 2008 20:16
Hi again!
Thanks again. As you say, it doesn't work locally, and that's all I wanted.
I was just trying to learn XHTML [off topic]. But thanks anyway!
Mike
This site was created by Mark "Tarquin" Wilton-Jones.
Don't click this link unless you want to be banned from our site.