JQuery never reaches success or fail on aspx returning json.

Posted by David on Stack Overflow See other posts from Stack Overflow or by David
Published on 2010-05-27T01:04:25Z Indexed on 2010/05/27 1:11 UTC
Read the original article Hit count: 329

Filed under:
|
|

Basicaly I have my aspx page doing

<%
        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?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about AJAX