以前用ajax都是驗(yàn)證一條數(shù)據(jù) 比如一個(gè)用戶名或者郵箱什么的 這個(gè)data都是一條input數(shù)據(jù) 但是現(xiàn)在是兩條數(shù)據(jù)了 怎么提交過(guò)去呢?用jsfunction ajax(url,data,funsucc){ var oAjax=new XMLHttpRequest();
oAjax.open('post',url,true);
oAjax.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=UTF-8");
oAjax.send("id="+data);
oAjax.onreadystatechange=function(){
if(oAjax.readyState==4){ if(oAjax.status==200){
funsucc(oAjax.responseText);
}
}
}
}<form id="fm1">
<input id="name" type="text">
<input id="password" type="text">
<button type="submit">提交</button>
</form>
ajax怎么把一個(gè)表單都提交過(guò)去??
蕪湖不蕪
2018-09-07 19:08:44