开发者

JQuery never reaches success or fail on aspx returning json

Basicaly I have my aspx page doing

开发者_StackOverflow社区<%
        Response.Clear();
        Response.Write("{\"Success\": \"true\" }");
        Response.End();
%>

My JQuery code is

function DoSubmit(r) {
    if (r == null || r.length == 0 || formdata == null || formdata.length == 0) return;
    for (i = 0; i < formdata.length; i++)
    {
        var fd = formdata[i];
        r[fd.Name] = fd.Value;
    }
    r["ModSeq"] = tblDef.ModSeq;
    jQuery.ajax({
        url: "NashcoUpdate.aspx"
        , succsess: doRow
        , error: DoSubmitError
        , complete: DoSubmitComplete
        , dataType: "json"
        , cache: false
        , data: r
        , type: "post"
    })
} 

When I call the DoSubmit() function every thing works but the doRow or DoSubmitError functions never get called only the DoSubmitComplete function.

When I look at the response text in teh DoSubmitComple function it is

{"Success": "true" }

Every JSON tester I have tried says that this is valied JSON. What am I doing wrong here?


You misspelled "success" as "succsess" ;)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜