views:

79

answers:

2

I've a Javascript Class and its method. But when i call it toJSON is generating an error. I couldn't figure out why this error is happening.

try {
    if (this.TabloEkId == undefined || this.TabloEkId == "") {
        throw errEksikVeri;
    }

    fAjaxSetup(fBefore, fSuccess, fError, fComplete);

    $.ajax({
        type: "POST",
        contentType: "application/json; charset=utf-8",
        url: ResolveUrl("~/Yonetim/WS/Yonetim.asmx/f_TabloEklerindenSil"),
        data: "{_tblEkId:" + this.TabloEkId + "}",
        dataType: "json"
    });

} catch (err) {
    f_ErrorViewer(err);
}

Javascript Class

Error

+1  A: 

toJSON doesn't seem to be base jQuery function. Are you including some kind of plug-in for that?

Ates Goral
+2  A: 

jQuery doesn't have built-in JSON serialization, and only their latest version detects native JSON APIs and uses them.

The toJSON() you seek is part of a jQuery plug-in.

I would use JSON2 if nothing else.

Cory Larson