标签:style http io os ar sp cti on c
function Getjson()
{
var str = "NKXZPJ.ashx";
var xhr = makexhr();
xhr.open("Post", str, true);
xhr.onreadystatechange = function ()
{
if (xhr.readyState == 4 && xhr.status == 200)
{
var res = xhr.responseText;
return res;
}
}
xhr.send(null);
}
//xhr 辅助方法;
function makexhr()
{
var xhr1;
try
{
if (window.XMLHttpRequest)
xhr1 = new XMLHttpRequest();
else if (window.ActiveXobject)
xhr1 = new ActiveXobject("Microsoft.XMLHTTP");
return xhr1;
}
catch (e)
{
alert("无法发送!");
}
}
标签:style http io os ar sp cti on c
原文地址:http://www.cnblogs.com/SunBlog/p/3989212.html