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