日期:2014-05-16 浏览次数:20778 次
<script type="text/javascript" language="javascript">
$(function() {
var params = "{\"u\":\"10086\",\"t\":\"yhdl_web\"}";
$.ajax({
type: "POST",
dataType: "json",
url: "http://localhost:4509/Handler1.ashx",
data: "{\"u\":\"10086\"}",
error: function(err) {
alert(err);
},
success: function(data) {
alert(data); //data就是你返回的数据
}
});
});
</script>
public class Handler1 : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
context.Response.Write("{\"s\":-1}");
}
public bool IsReusable
{
get
{
return false;
}
}
}