XMLHttpRequest sporadic and slow response

BuivaStatOvab

New Member
Hello all!I have a problem with my XMLHttpRequest. I don't know if it is my code's hierarchy or the XMLHttpRequest. I am using Javascript, XML, and a little AJAX.My XML code works fine when I am communicating with the server, it is very fast and I get updates very quickly, but when I am trying to call my callback method, it is VERY slow, or sometimes doesn't even register. I call \[code\]send()\[/code\] which has a \[code\]baseURL\[/code\], then creates the XML it is looking for, then registers the callback method. The XML and callback methods do work, but for some reason they do not register with the server instantaneously. So, is there something inefficient with my XML code, is it the class hierarchy, what am I doing wrong? Here's the XML code I use to hit the server: \[code\]function send(url, xml, callback) { var xmlhttp = new XMLHttpRequest(); xmlhttp.withCredentials = true; xmlhttp.onreadystatechange = function(){if(xmlhttp.readyState==4){callback(xmlhttp);}} xmlhttp.open("POST", baseURL + url, true); xmlhttp.send(xml);}\[/code\]
 
Back
Top