function Ajax(url, data, method) { var xmlHttp = null; if (window.XMLHttpRequest) { xmlHttp = new XMLHttpRequest(); } else { var MSXML = ['Microsoft.XMLHTTP', 'MSXML.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.7.0', 'Msxml2.XMLHTTP.6.0', 'Msxml2.XMLHTTP.5.0', 'Msxml2.XMLHTTP.4.0', 'MSXML2.XMLHTTP.3.0', 'MSXML2.XMLHTTP'] for (var n = 0; n < MSXML.length; n++) { try { xmlHttp = new ActiveXObject(MSXML[n]); break; } catch (e) { return; } } } var responseText = ""; xmlHttp.open("post", url, true); xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xmlHttp.send(data); xmlHttp.onreadystatechange = function () { if (xmlHttp.readyState == 4) { var responseText = xmlHttp.responseText; if (xmlHttp.status != 200) return; if (typeof (method) === "function") { method(responseText); } } } }
function verfiyEmoneyPWD() { var pwd = $("#dyqPwd")[0].value; var url = "AjaxPages/VerifyIntegrationPwd.aspx?uid=" + document.getElementsByName("Userid")[0].value + "&pwd=" + pwd; var result; Ajax(url, null, function (responseText) { if (responseText == "T") { result = true; } else { result = false; } }); return result; }
作者:Tyler Ning
出处:http://www.cnblogs.com/tylerdonet/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,如有问题,可以通过以下邮箱地址williamningdong@gmail.com 联系我,非常感谢。