I’m trying to set up a page which read the table and then makes a single XMLhttprequest post to a CGI program for every entry. I’ve been able to do everything except submit multiple posts. what’s making this difficult is that I need to serialize requests because each request can take up to three or four seconds to execute. The test page is at [url=http://harvee.org/files/correct.html] http://harvee.org/files/correct.html[URL=http://harvee.org/files/camram.js]http://harvee.org/files/camram.js
the actual code which is causing the problems is:
[code]var table_list = null;
var table_index = 0;
function processtab(){
var xmlHttpReq = false;
var self = this;
// Mozilla/Safari
if (window.XMLHttpRequest) {
self.xmlHttpReq = new XMLHttpRequest();
alert(“got XMLHttpRequest”);
}
// IE
else if (window.ActiveXObject) {
self.xmlHttpReq = new ActiveXObject(“Microsoft.XMLHTTP”);
}
build_table();
//alert(“built table”);
//alert(“pre open”);
self.xmlHttpReq.open(‘POST’, “/cgi/test”, true);
//alert(“post open”);
self.xmlHttpReq.setRequestHeader(‘Content-Type’, ‘application/x-www-form-urlencoded’);
//alert(“pre orsc”);
self.xmlHttpReq.onreadystatechange = function() {
//alert(“pre state test”);
if (self.xmlHttpReq.readyState == 4) {
if (table_index < table_list.length){
var el = table_list[table_index];
var working = el;
while (working.tagName != “TR”){
working = working.parentNode;
}
working.style.visibility = ‘hidden’;
working.style.display = ‘none’;
alert(“in loop”);
table_index += 1;
self.xmlHttpReq.send(send_query_string());
}
}
} ;
alert(“pre-send”);
self.xmlHttpReq.send(send_query_string());
return false;
}
I haven’t found anything on the net describing how to handle this problem. if I’m missing something, please let me know.