var namestring="<aa><bb>123</bb></aa>"
xmlHttp.open("POST", url);
xmlHttp.onreadystatechange = callback;
xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
xmlHttp.send(namestring);
可以传递字符串但是必须为xml格式,通过服务器端接受
xmlHttp.open("POST", url);
xmlHttp.onreadystatechange = callback;
xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
xmlHttp.send(namestring);
可以传递字符串但是必须为xml格式,通过服务器端接受
解决方案 »
- PHP多维数组问题求解?
- 小鸟问问题。。 selected 标签 在修改页面中接收参数的问题。
- 求教var_dump()的问题
- 为什么在linux下mb_convert_encoding()用不了?
- php难题,寻高手
- file_get_contents读取xls一片乱码?
- 这个函数里的参数怎么解释?手册里没有
- 找本汉化最完全的PHP手册
- 安装了ZEND SEVER 开启的时候弹出浏览器 提示以下错误 怎么解决?
- 请教:用php可以得到远程用户的ip,那如何用php得到远程用户的mac地址?
- 有分拿还可以找工作,北京高薪聘请PHP程序员。你准备好了吗?
- 求中国省份和城市的MYSQL数据库,在线等。谢谢
xmlHttp.open()后不就接受了么?
我不要send(null)都可以运行呢?假如send(x)中的x不为空,服务器端接受什么?怎么接受?PHP怎么接受怎么处理这个x?
var SendData = 'regid='+aa+'®password='+bb
X.send(SendData)
可以这样传递
X.send(SendData)
就有用场了
从web表单获取数据后到js里
1 创建XMLHttpRequest对象
2 然后用这个对象操作open()方法 即 XMLHttpRequest.open("post",url,true);
3 用这个对象操作onreadystatechange这个属性
即XMLHttpRequest.onreadystatechange=callback; //指定响应函数
4 用这个对象操作send()方法 即 XMLHttpRequest.send(null);现在我想问下 2 3 4这个顺序可以随便写么,就是先XMLHttpRequest.onreadystatechange=callback; //指定响应函数
在
XMLHttpRequest.open("post",url,true);
另外我很奇怪,为什么没send()就先执行返回相应函数了??就是
先 XMLHttpRequest.onreadystatechange=callback; //指定响应函数
然后再 XMLHttpRequest.send(null);
都没发送,怎么获取返回的数据呢?
麻烦大家帮帮忙解释下!越详细越好!