Randy said:
Roy A. said the following on 1/9/2007 7:11 AM:
Yes it is. IE7 uses a native object instead of an ActiveX object for the
XMLHttpRequest.
Think about what that line says.
XMLHttpRequest without XMLHTTP?
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ -
http://jibbering.com/faq/index.html
Javascript Best Practices -
http://www.JavascriptToolbox.com/bestpractices/
As has already been mentioned the term AJAX implies the use of XML, but
it's sometimes a little fickle in my experience. Perhaps Roy made a
typo and intended to reference "http.responseText" instead of
"XMLHTTPRequest".
I always seem to run into small snags with XML and have resorted to
using simple character-delimited lists, when my problem domain doesn't
require anything more sophisticated. Here's an example of that, where
my data page will return a pipe-delimited list with 3 elements. For
example: "112197|1.4696248|0.5309032" which is the primary key of my
record, longitude, and latitude.
Even though this is a bastardization of "AJAX" it works well and saves
me a lot of headache.
RESPONSE HANDLER:
function useHttpResponse() {
if (http.readyState == 4) {
if(http.status == 200) {
if ( http.responseText.length ) {
var aLong = http.responseText.split('|');
lngPtr = document.getElementById(longAmt);
latPtr = document.getElementById(latAmt);
lngPtr.value = aLong[1];
latPtr.value = aLong[2];
}
}
}
}
DATA PAGE:
<?php
// include db and query components
require_once("qryMySQLConn.php");
require_once("qryDataUDF.php");
$rsZipDtl = getZipDetail($_GET[userString]);
if ( $rsZipDtl ) {
for ($i=0; $i<mysql_num_rows($rsZipDtl); $i++) {
$ntRowObj = mysql_fetch_object($rsZipDtl);
if($i) {
$cLineStr = "~";
}
else {
$cLineStr = "";
}
$cLineStr =
$cLineStr."$ntRowObj->zipID|$ntRowObj->zipRLongitude|$ntRowObj->zipRLatitude";
}
}
echo($cLineStr);
?>