日期:2014-05-16 浏览次数:20671 次
function Data_Insert(sendURL)
{
var asmxURL = "http://127.0.0.1/Project/Webservice/test.asmx/test"
//var asmxURL = "http://其他IP/Project/Webservice/test.asmx/test"
var xmlhttp = window.MyXMLHttpRequest();
xmlhttp.onreadystatechange = function()
{
if (xmlhttp.readyState == 4) // 调用完毕
{
if (xmlhttp.status == 200) // 加载成功
{
var xmlObj = xmlhttp.responseXML;
var root = xmlObj.documentElement;
var childs = root.childNodes;
if(childs.length <= 0)
{
alert("出错了");
}
else if(childs[0].text != "")
{
alert("OK");
}
}
else
{
alert("出错了");
}
}
}
xmlhttp.open("POST",asmxURL, true);
xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;charset=utf-8');
xmlhttp.send(sendURL);
}