Function executecommand (){
VaR commandparam = $ ('# command'). Val () + "" + $ (' # options'). Val ();
Commandparam = escape (commandparam );
VaR url = "/goform/formexecutepicommand ";
XMLHTTP. Open ("Post", URL, true );
XMLHTTP. setRequestHeader ("Content-Type", "application/X-WWW-form-urlencoded ");
XMLHTTP. onreadystatechange = callbackfunction;
XMLHTTP. Send ("command =" + commandparam );
}
Function callbackfunction (){
If (XMLHTTP. readystate! = 4 ){
Return;
}
VaR result = "";
If (XMLHTTP. Status = 200 ){
Result = XMLHTTP. responsetext;
// Resultxml = XMLHTTP. responsexml;
// Result = resultxml. getelementsbytagname ('executionresult'). Item (0 );
} Else if (XMLHTTP. Status = 404 ){
Result = "requested file not found ";
} Else {
Result = "error has occurred with status code:" + XMLHTTP. status;
}
$ ('# Executionresult'). Val (result );
}
VaR XMLHTTP;
Try {
XMLHTTP = new XMLHttpRequest (); // standard XML request
} Catch (trymicrosoft) {// IE 6 case
Try {
XMLHTTP = new activexobject ("msxml2.xmlhttp ");
} Catch (othermicrosoft ){
Try {
XMLHTTP = new activexobject ("Microsoft. XMLHTTP ");
} Catch (failed ){
XMLHTTP = false;
}
}
}