ToJSON "Object does not support this property or method"

I have a Javascript class and a method. But when I call it, JSON throws 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

+2


a source to share


1 answer


jQuery has no built-in JSON serialization, and only their latest version detects the built-in JSON APIs and uses them.

The ToJSON () you are looking for is part of the jQuery plugin.



I would use JSON2 if nothing else.

+2


a source







All Articles