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;
}
}
}