日期:2014-05-16  浏览次数:20736 次

ajax传值 - Web 开发 / Ajax
$.get("showpic.ashx",{"name":"测试"},function(data,textstatus){});
$.post("showpic.ashx",{"name":"测试"},function(data,textstatus){});

showpic.ashx页面代码:
context.Request.QueryString["name"];

我用get方式 可以取到值,而用post方式 却是空值。

 这是什么状况??区别在那??
 

------解决方案--------------------
http://topic.csdn.net/u/20080802/14/80d9b92e-461c-440d-bdb3-15f6aa6514dc.html?1648585608

http://topic.csdn.net/u/20091126/13/60b38e4d-0e0b-4167-8c8c-92fe95ece23b.html
------解决方案--------------------

原生js ajax
需要在
xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
在xmlHttp.send()方法之前