I am very lost here. Any help would be great. I am using xmlhttp on another
project without any errors. But for the life me I can't figure this out.
Alert(httpObj.responseText); will display the xml and the xml will display in
IE so I dont' think it's bad xml document. But alert(httpObj.responseXML);
display nothing (not null), but nothing just blank message box. When I try to
access a tag by name I get an error,because there is nothing in the xml obj.
Here is the xml I am seing in httpObj.responseText:
<?xml version="1.0"
?><NumberOfJobApps><error>0</error><recordcount>2<recordcount></NumberOfJobApps>
Here is the code I am using:
<script language="JavaScript" type="text/javascript">
var httpObj = null;
try {
httpObj = new ActiveXObject("Microsoft.XMLHTTP");
}catch(error) {
try {
httpObj = new ActiveXObject("Msxml2.XMLHTTP");
}catch(error) {
httpObj = null;
}
}
if(!httpObj && typeof XMLHttpRequest != "undefined") {
httpObj = new XMLHttpRequest();
}
</script>
<script language="JavaScript" type="text/javascript">
function GetJobData(ssn1,ssn2,ssn3){
if(httpObj.readyState != 0) {
httpObj.abort();
}
if (JobForm.SSN1.value != "" && JobForm.SSN2.value != "" && JobForm.SSN3.value
!= "") {
if(httpObj) {
httpObj.abort();
httpObj.open("GET", "qryJobData.cfm?ssn=" + ssn1+"-"+ssn2+"-"+ssn3,
true);
httpObj.onreadystatechange = function() {
if (httpObj.readyState == 4){
var xmlObj = httpObj.responseXML;
alert(xmlObj.xml);
var rcObj = xmlObj.getElementsByTagName("recordcount");
// if (httpObj.responseText &&
httpObj.responseXML.getElementsByTagName('recordcount').item(0).firstChild.data
==0){
// JobForm.PrevEmployee.focus();
// return false; }
// if(httpObj.responseText &&
httpObj.responseXML.getElementsByTagName('recordcount').item(0).firstChild.data
>1) {
// alert("It has been less then 30 days since your last application.\n
Please wait until it has been more then 30 days");
// return false;}
}
}
httpObj.send(null);
}
}
}
</script>
David
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:208617
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54