Hi Adam


There is a quite a large bug in IE that has been around for a long time concerning accept headers the browser sends to the server. For those who don't know what the accept header is - it just tells the server what mime types the User Agent can handle.
IE sends correct headers to the server but on refreshing a page they disappear (the string becomes */* from memory).


This may effect the code below - for mime types that are present in the IE accept string. It's worth remembering this when attempting to find what content the UA can parse natively (e.g in server side Flash Player detection).

Cheers
James

Adam Carmichael wrote:


Rob Halff wrote:


<!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"; xml:lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=iso-8859-1" />



And since your using PHP, add this to your template, or what have you, to make sure that the webserver sends the appropriate Content-Type if the UA can read XHTML.


<?php
if(stristr($_SERVER['HTTP_ACCEPT'],"application/xhtml+xml"))
  {
    header('Content-Type: application/xhtml+xml');
  }
?>

(Just as a tidbit, MSIE appears to be able to parse XHTML just fine, but when you throw the correct Content-Type at it, MSIE thinks it can't read it, so it'll ask the user to select an application which can read it - thankfully MSIE does not add application/xhtml+xml to it's accept string, so you won't get this problem.)

Out of curiosity, what does the CF source look like to do the same thing?

Adam

*****************************************************
The discussion list for http://webstandardsgroup.org/
*****************************************************




Reply via email to