XHTML and Internet Explorer?

Microsoft Windows operating system, and software for Windows platform, including QuickTime Player and iTunes for Windows. We also discuss topics about Microsoft Corp.

Moderators: Josh, Don_HH2K, Mandrake

XHTML and Internet Explorer?

Postby Don_HH2K » Fri 05 Nov, 2004 10:22 pm

OK, this is puzzling me now. I recently converted my website to XHTML to avoid the Angelfire ads. It looks great in Netscape. I decided to test it in Internet Explorer, but IE decided not to read it and say that "the website was trying to download harmful content to my computer". After clicking "Download File" to override, the page opened up in Netscape anyway. I was under the impression that Internet Explorer had XHTML support in versions 6+, am I correct? Is this just a problem with my computer, or what? Any suggestions would be appreciated.
UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax)
Laptop: HP Compaq nx6325 - Turion 64 X2 @ 2GHz, 2GB DDR2, 100GB HD, ATI Radeon X300, 15" LCD, Seven Pro
Handheld: Palm Treo 650 - Intel PXA270 @ 312MHz, 10MB RAM, 32MB flash, 2.7" LCD, Palm OS 5.4
User avatar
Don_HH2K
Moderator
Moderator
 
Posts: 5112
Joined: Sun 09 May, 2004 3:59 pm

Postby Al » Fri 05 Nov, 2004 11:22 pm

i think it's only partial
UserAgent: Mozilla/5.0 (Windows; U; Win98; rv:1.7.3) Gecko/20041001 Firefox/0.10.1 (Pikachu90000's Mozilla Firefox/0.10.1 rebrand)
User of Firefox :ff: 3.0 on Windows XP
User avatar
Al
diamond member
diamond member
 
Posts: 1694
Joined: Fri 20 Dec, 2002 1:08 pm

Postby Shark Daddy » Mon 08 Nov, 2004 2:46 am

You need to stop serving it as [tt]application/xhtml+xml[/tt] and you need to put the file extension back to [tt].html[/tt] (besides... nobody uses [tt].xhtml[/tt]). It's a famous shortcoming of IE with XHTML.

If you have the means, give non-IE browsers the correct MIME type and baby IE. For example, I use this PHP on a few websites of mine:

Code: Select all
if(stristr($_SERVER['HTTP_ACCEPT'],"application/xhtml+xml")) {
      header("Content-type: application/xhtml+xml");
      } else {
      header("Content-type: text/html");
      }
UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040803 Firefox/0.9.3
Shark Daddy
Moderator
Moderator
 
Posts: 519
Joined: Wed 19 Jun, 2002 11:19 am
Location: Toronto, Canada

Postby Don_HH2K » Mon 08 Nov, 2004 4:14 pm

OK, I now see what needs to be done. The only problem is, the reason I converted to XHTML was to bypass the Angelfire ad code that is applied to all files with an HTML extension (has nothing to do with the MIME type, already checked that). I will use the PHP script that you gave me to get it to work properly. But, since IE guesses the MIME type and will receive [tt]text/html[/tt], would it be possible to use [tt].xml[/tt] as an extension instead?
UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax)
Laptop: HP Compaq nx6325 - Turion 64 X2 @ 2GHz, 2GB DDR2, 100GB HD, ATI Radeon X300, 15" LCD, Seven Pro
Handheld: Palm Treo 650 - Intel PXA270 @ 312MHz, 10MB RAM, 32MB flash, 2.7" LCD, Palm OS 5.4
User avatar
Don_HH2K
Moderator
Moderator
 
Posts: 5112
Joined: Sun 09 May, 2004 3:59 pm

Postby Shark Daddy » Mon 08 Nov, 2004 6:16 pm

Try it. I seem to recall going through all that myself... but really there's no reason other than aesthetics to not call it .html that I can see. IE (stupidly) looks at file extensions in addition to MIME types, so I'm pretty sure it'll treat it as a straight XML file. But there's no harm in trying, of course.
UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040803 Firefox/0.9.3
Shark Daddy
Moderator
Moderator
 
Posts: 519
Joined: Wed 19 Jun, 2002 11:19 am
Location: Toronto, Canada


Return to Windows (and Microsoft talk)

Who is online

Registered users: Google [Bot]

cron