Trying to get to grips to ajax... I have written a script to check the response of a php page... as of the minute the php page simply returns "0", However it seems that no matter what the content of the php page (LiveAssistanceHandle.php), the result always comes back as "1".
Can anyone point out my mistake here?
function init(){
var xmlhttp;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
var response = xmlhttp.responseText;
if (response == "1"){
alert ("Picked Up - " + response);
}else{
alert ("Not Picked Up - " + response);
}
}
}
xmlhttp.open("GET","LiveAssistanceHandle.php",true);
xmlhttp.send();
}
window.onload = init;
Help














