$.ajax({
url: href,
dataType: "json",
context: document.body,
cache: false,
type: "post",
data: "textBoxId=" + textBoxId,
success: function (result) {
alert("success");
},
error: function (error) {
document.write(error.responseText);
}
});
一般情况下,都会成功,但好像一旦json的长度超过某个值时,就会失败,但error方法里的输出,证明了数据已经拿过来了,既然数据拿到了,为什么还会失败。
------解决方案--------------------
是不是json格式不正确呀。没听说json太长会造成ajax请求失败
------解决方案--------------------
是啊,没听过json长度会导致请示失败啊,楼主还是多看看json串的格式, 用firebug json 格式