note 97554 modified in class.domdocument by danbrown

From: Date: Mon, 26 Apr 2010 14:31:46 +0000
Subject: note 97554 modified in class.domdocument by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-168656@lists.php.net to get a copy of this message
If you're using AJAX, make sure you put a header directive like the following at the top of your php file. <?php header( "content-type: application/xml; charset=ISO-8859-15" ); ?> If you don't add this header then your javascript downloadURL function will not work because the content type will not be recognised to be XML. --was-- Using AJAX? Then make sure you put a header directive like the following at the top of your php file. header( "content-type: application/xml; charset=ISO-8859-15" ); Had to read every comment to find this as it was noted as the first post to this document by Fernando H back in 2008. I'm reposting this snippet as I think a lot of people, like me, will be using this for dynamically generating XML for JavaScript (i.e. AJAX). If you don't add this header then your javascript downloadURL function will not work because the content type will not be recognised to be XML. http://php.net/manual/en/class.domdocument.php

« previous php.notes (#168656) next »