javascript调用webservices 怎么用post方式传值

发布网友 发布时间:2022-04-23 15:02

我来回答

2个回答

热心网友 时间:2022-04-24 17:41

var xhr=new XMLHttpRequest();
xhr.onreadystatechange=function(){
if (xhr.readyState==4 &&
xhr.status>=200 &&
xhr.status<400){
// 这里是请求成功后执行的代码
}
};
xhr.open('post',"WebService.asmx/方法名?参数="+parm.value,true);
xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
xhr.send(da);

热心网友 时间:2022-04-24 18:59

xmlHttp.open("post",url,false);
xmlHttp.setRequestHeader("content-type","application/x-www-form-urlencoded");
xmlHttp.send("参数名=值&参数名=值");

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com