The common implementation I read online is something to this extent:
Two methods: encode an XML document in PHP, or separating the data in a string using delimiters (e.g. |||).
An XML response can be handled by:
While the delimited response can be iterated easily after parsing it into an array:
data = httpRequest.responseText.split('|||');
httpRequest['onreadystatechange'] = new Function('
if (httpRequest[readyState] == 4)
<font size='1'>(may have syntax errors; done on the fly)
<font size='2'>I made various PHP functions to handle DOM manipulation routines (e.g. form error checking) with data.
For example, populating a form from a query:
foreach ($data as $key => $value)
echo "document.getElementById('$key').value = '".addslashes($value)."';";
$profile = $Db->fetchRow("
SELECT profileId, firstName, lastName, phone
WHERE profileId = $profileId