$.ajax({ type: "post", url: "../Handler.ashx", data: { type: "test"}, success: function (data) { var obj = eval("(" + data + ")"); alert(obj); } })
$.post("../Handler.ashx", { type: "test" }, function (data) { return 1; });
context.Response.ContentType = "text/plain"; string type = context.Request["type"]; …… else if(type == "test") { string str = "{ result:'1' }"; context.Response.Write(str); }
注:js文件目录在js文件夹下,ashx文件目录在根目录。
搞了半天,为什么Js始终取不到传递过来的值呢?求救~!
我都是按照以前的方法弄的,难道是我机子有问题?。。
慕田峪9158850
哈士奇WWW
繁星点点滴滴
狐的传说
慕尼黑8549860
互换的青春
梦里花落0921
墨色风雨
梵蒂冈之花