编码 :
function CallSyncAjax(url, resid) {
try { parent.TimeOut(); } catch (ex) { }
var xmlhttp = new GetXmlHttp();
if (xmlhttp) {
    xmlhttp.onreadystatechange = function () {
        if (xmlhttp && xmlhttp.readyState == 4) {//we got something back..
            if (xmlhttp.status == 200) {
                var StrResponse;
                StrResponse = xmlhttp.responseText.split('@@@');
                if (xmlhttp.responseText != "") {
                    if (StrResponse[0] != "") {
                        if (resid == "1000") {
                            //this function exist in ContactsList.apsx
                            AddGroupToMenu(StrResponse[0]);
                        }
                    }
                }
            }
        }
    }
    xmlhttp.open("post", url, true);
    xmlhttp.send();
  }
}
我从按钮上的页面调用此函数,如下所示:
CallSyncAjax("?ExtFlag=saveGroup&AjaxFalg=SpecialRequest&groupName=" + TxtGroupName.GetText() + "&groupDesc=" + TxtgroupDesc.GetText(), "1000");
我的问题是我可以缓存结果,所以当我再次单击按钮时,不会调用 ajax 调用而只是从缓存中读取结果?