Below are code snippets. I've got two questions for the two calls inside function
rescanNetwork
:
<pre> newAJAXCommand('scan.cgi?scan=1');
and
<pre> setTimeout("newAJAXCommand('status.xml', updateStatus, false)", 50);
For the first call, the parameter (
Quote:
'scan.cgi?scan=1'
)
but the content of scan.cgi is "
Quote:
Success! ~scan~
". In my understanding, scan.cgi is a CGI script, how come "Success! ~scan~" doesn't look like a script program? What language is it?
For the second call,
Quote:
"newAJAXCommand('status.xml', updateStatus, false)"
, status.xml should be a CGI script too, but can a XML file be a script program?
<pre>
function newAJAXCommand(url, container, repeat, data)
{
var newAjax = new Object();
var theTimer = new Date();
newAjax.url = url;
newAjax.container = container;
newAjax.repeat = repeat;
newAjax.ajaxReq = null;
if (window.XMLHttpRequest) {
newAjax.ajaxReq = new XMLHttpRequest();
newAjax.ajaxReq.open((data==null)?"GET":"POST", newAjax.url, true);
newAjax.ajaxReq.send(data);
} else if (window.ActiveXObject) {
newAjax.ajaxReq = new ActiveXObject("Microsoft.XMLHTTP");
if (newAjax.ajaxReq) {
newAjax.ajaxReq.open((data==null)?"GET":"POST", newAjax.url, true);
newAjax.ajaxReq.send(data);
}
}
newAjax.lastCalled = theTimer.getTime();
ajaxList.push(newAjax);
}
<pre>function rescanNetwork()
{
scanDots = 0;
printButtonName();
document.getElementById("rescan").disabled = true;
newAJAXCommand('scan.cgi?scan=1');
deleteScanTable();
currBss = 0;
setTimeout("newAJAXCommand('status.xml', updateStatus, false)", 50);
}
What I have tried:
I studied relative knowledge inside this post, but still unable to figure out my question.