var xmlHttp;function createXMLHttpRequest(){ if (window.ActiveXObject){ xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } else if (window.XMLHttpRequest){ xmlHttp = new XMLHttpRequest(); }}function startAjaxRequest(method,async,actionUrl,data, invokeMethod){ createXMLHttpRequest(); xmlHttp.open(method, actionUrl, async); xmlHttp.onreadystatechange = handleStateChange; xmlHttp.send(data); function handleStateChange(){ if(xmlHttp.readyState == 4){ if(xmlHttp.status == 200){ var nodeId = xmlHttp.responseText; if (nodeId=='noPermission'){ alert('你没有权限访问此操作!'); }else if( (falseIndex = nodeId.indexOf("false||"))!= -1 ){ alert('操作失败,可能的原因为:' + nodeId.substring(falseIndex+7, nodeId.length) + "!"); }else if(nodeId=='false'){ alert('操作失败,请和管理员联系!'); }else ...{ if (invokeMethod == undefined){ getResult(nodeId); } else { invokeMethod(nodeId); } } } } }} |