ajax提交表单

来源:互联网 发布:手机淘宝买东西步骤 编辑:程序博客网 时间:2024/05/18 00:47
var   DataToSend   =   "id=1&word=hello ";
var   xmlhttp   =   new   ActiveXObject( "Microsoft.XMLHTTP ");
xmlhttp.Open( "POST ", "Receiver.asp ",false);
//关键在下面这句
xmlhttp.setRequestHeader( "Content-Type ",   "application/x-www-form-urlencoded ");
xmlhttp.send(DataToSend);
alert(xmlhttp.responseXML.xml);
原创粉丝点击