We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS

Writing JavaScript for XHTML

Couple of notes :

1) The php example for detecting if the client accepts xhtml+xml will result in a php error of the client doesn't send what it accepts.

if (isset($_SERVER['HTTP_ACCEPT')) {
if( strpos( $_SERVER['HTTP_ACCEPT'], "application/xhtml+xml" ) ) {
  header( "Content-type: application/xhtml+xml" );
  echo '<?xml version="1.0" ?>'."\n";
} else {
  header( "Content-type: text/html" );
} else {
  header( "Content-type: text/html" );
}

solves that.

2) If you use the above trick, then you can't use the CDATA trick because it seems to cause issues in non xhtml+xml.

3) The "DOM changed" section is almost entirely incorrect.  Should we just remove it?

Document Tags and Contributors

Contributors to this page: Bzbarsky, FunkyRes
Last updated by: Bzbarsky,