function getorder(){ alert("1");
var orderkey = $("#Text23").val();
var ht = "";
$.ajax({
type: "POST",
url: "Ashx/getorder.ashx?orderkey=110820100120231547",
success: function(or) {
alert("x");
}
});
}根本就不不成功,没有执行success 里面Ashx/getorder.ashxnamespace Gxbd.Web.Ashx
{
/// <summary>
/// $codebehindclassname$ 的摘要说明
/// </summary>
[WebService(Namespace = "http://www.gxbd.com/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class GetOrder : IHttpHandler
{
GetOrderJson goj = new GetOrderJson();
public void ProcessRequest(HttpContext context)
{
try
{
context.Response.ContentType = "text/plain";
if (context.Request.QueryString["orderkey"] == null)
{
return;
} string orderid = context.Request.QueryString["orderkey"].ToString(); context.Response.Write(goj.GetOrder(orderid));
}
catch (Exception e)
{
throw e;
}
} public bool IsReusable
{
get
{
return false;
}
}
}
}直接调用goj.GetOrder("110820100120231547")
输出{"order":{"price":"62","res":"已经验收"}}
var orderkey = $("#Text23").val();
var ht = "";
$.ajax({
type: "POST",
url: "Ashx/getorder.ashx?orderkey=110820100120231547",
success: function(or) {
alert("x");
}
});
}根本就不不成功,没有执行success 里面Ashx/getorder.ashxnamespace Gxbd.Web.Ashx
{
/// <summary>
/// $codebehindclassname$ 的摘要说明
/// </summary>
[WebService(Namespace = "http://www.gxbd.com/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class GetOrder : IHttpHandler
{
GetOrderJson goj = new GetOrderJson();
public void ProcessRequest(HttpContext context)
{
try
{
context.Response.ContentType = "text/plain";
if (context.Request.QueryString["orderkey"] == null)
{
return;
} string orderid = context.Request.QueryString["orderkey"].ToString(); context.Response.Write(goj.GetOrder(orderid));
}
catch (Exception e)
{
throw e;
}
} public bool IsReusable
{
get
{
return false;
}
}
}
}直接调用goj.GetOrder("110820100120231547")
输出{"order":{"price":"62","res":"已经验收"}}
alert(x.status);看看是什么消息
}