麻烦帮看一下我这个jquery ajax查询为什么总是报错

ken080504 2012-06-19 10:27:29
$.ajax({
type: "POST",
url: "BusinessSearchHelper.ashx",
data: { star: starTiem, end: endTiem, acc: account, type: check },
datatype: "html",
success: function(ReturnData) {
$("#showData").html(ReturnData);
},
error: function(RetrunError) {
$("#showData").html(RetrunError);
}
});


BusinessSearchHelper.ashx里面的代码



using System;
using System.Web;
using STBKen.BLL;
using STBKen.Entity;
using System.Text;
using System.Collections.Generic;

public class BusinessSearchHelper : IHttpHandler {

string starTime;
string endTime;
string account;
string type;
BLLOperator bll = new BLLOperator();
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/html";
starTime = context.Request.Params["star"].ToString().Trim();
endTime = context.Request.Params["end"].ToString().Trim();
account = context.Request.Params["acc"].ToString().Trim();
type = context.Request.Params["type"].ToString().Trim();

List<Entity_CLP> LSclp = bll.SearchCPL_BLL(starTime,endTime,account,0,20);
StringBuilder sb = new StringBuilder();
foreach(Entity_CLP clp in LSclp)
{
sb.Append("<Table>");
sb.Append("<tr>");
sb.Append("<td>"+clp.Account+"</td>");
sb.Append("<td>" + clp.Clpno + "</td>");
sb.Append("<td>" + clp.La_no + "</td>");
sb.Append("<td>" + clp.Recla_date + "</td>");
sb.Append("<td>" + clp.Xingqi + "</td>");
sb.Append("<td>" + clp.Client + "</td>");
sb.Append("<td>" + clp.So_no + "</td>");
sb.Append("<td>" + clp.Rec_date + "</td>");
sb.Append("<td>" + clp.XingqiSO + "</td>");
sb.Append("<td>" + clp.Tocbm + "</td>");
sb.Append("</tr>");
sb.Append("</Table>");
}
context.Response.Write(sb.ToString());
}



public bool IsReusable {
get {
return false;
}
}
...全文
86 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
Ahoo 2012-06-19
  • 打赏
  • 举报
回复
朋友,你这是报的什么错。
ken080504 2012-06-19
  • 打赏
  • 举报
回复
没改前是报:object Object

后来我改成如下代码:
error: function(XMLHttpRequest, messges) {
alert(messges);
}
报:error



三石-gary 2012-06-19
  • 打赏
  • 举报
回复
报什么错误。。错误信息
三石-gary 2012-06-19
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 的回复:]
data: { star: starTiem, end: endTiem, acc: account, type: check },
这是发问题的时候大错的?
[/Quote]
看错了。。忽略它
三石-gary 2012-06-19
  • 打赏
  • 举报
回复
data: { star: starTiem, end: endTiem, acc: account, type: check },
这是发问题的时候大错的?
ken080504 2012-06-19
  • 打赏
  • 举报
回复
总是提示error
ken080504 2012-06-19
  • 打赏
  • 举报
回复
error:参数有以下三个:XMLHttpRequest 对象、错误信息、(可选)捕获的错误对象。如果发生了错误,错误信息(第二个参数)除了得到null之外,还可能是"timeout", "error", "notmodified" 和 "parsererror"。


这是我在网上查到的,但是总是得不到真正的错误信息
ken080504 2012-06-19
  • 打赏
  • 举报
回复
error里不是有几个参数吗?第二个是错误信息(网上查的)我只是直接把那个参数信息读出来。具体我也不怎么会用,所以问问大家

52,797

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 Ajax
社区管理员
  • Ajax
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧