For some reason my ajax request keeps repeating. It appears to be one of these places where the code runs ahead of itself, because when I put in a breakpoint in firebug, I can step through the data. But I also see that firebug reports an error in it's execution.
Here is my code.
somehow line 41 never executes without a break point even though the ajax query continues returning valid results (same results) over and over again until I stop the browser.
Here is my code.
somehow line 41 never executes without a break point even though the ajax query continues returning valid results (same results) over and over again until I stop the browser.
Code:
var cGetTimeHttp;
function getSelectWeekTime(aObj)
{
if (window.ActiveXObject)
{
cGetTimeHttp = new ActiveXObject("Microsoft.XMLHTTP");
}else if (window.XMLHttpRequest) {
cGetTimeHttp = new XMLHttpRequest();
}
var url = "/SMNO/dailyTimeReview2.exe?timeStamp=" + new Date().getTime();
var queryString = buildGetTime(aObj);
cGetTimeHttp.onreadystatechange = handleGetTimeStateChange;
cGetTimeHttp.open("POST", url, true);
cGetTimeHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
cGetTimeHttp.send(queryString);
}
function buildGetTime(aObj)
{
qString = "";
qString += "&MinDate='" + aObj[0] + "'";
qString += "&MaxDate='" + aObj[1] + "'";
qString += "&Reviwer='" + aObj[2] + "'";
for (var i = 3; i < aObj.length; i++ )
{
qString += "&Dept"+(i-2)+"='" + aObj[i] + "'";
}
qString += "&method=POST";
return qString;
}
function handleGetTimeStateChange()
{
if (cGetTimeHttp.readyState == 4)
{
if (cGetTimeHttp.status == 200)
{
parseGetTimeResults();
}
}
}
function parseGetTimeResults() {
//assign the returned value to a variable
var returnedString = cGetTimeHttp.responseText;
//create an array to store the information
var aReturn = new Array();
//parse the string into the array using the semi-colon to separate each value
aReturn = returnedString.split('@');
}
Comment