Помогите найти ошибку в Ajax

  • Автор темы lampa
  • Дата начала
L

lampa

#1
[codebox]<script>

function getXmlHttpRequestObject() {
if (window.XMLHttpRequest) {
return new XMLHttpRequest(); //Not IE
} else if(window.ActiveXObject) {
return new ActiveXObject("Microsoft.XMLHTTP"); //IE
} else {
alert("Your browser doesn't support the XmlHttpRequest object. Better upgrade to Firefox.");
}
}




var receiveReq = getXmlHttpRequestObject();




function removePost(id) {
//If our XmlHttpRequest object is not in the middle of a request, start the new asyncronous call.
if (receiveReq.readyState == 4 || receiveReq.readyState == 0) {
receiveReq.open("GET", "http://localhost:8080/BLOG/RemoveServlet?ID=" + id, true);
receiveReq.onreadystatechange = handlePost(id);
receiveReq.send(null);

}
}


//Called every time our XmlHttpRequest objects state changes.
function handlePost(number) {
if (receiveReq.readyState == 4) {
f_delete(number);
}
}

</script>[/codebox]

Проблема в том , что запрос не посылаться в сервлет.
Помогите понять в чем дело.
Заранее спасибо!!!!