toJSON“对象不支持此属性或方法”

时间:2010-05-08 15:12:43

标签: javascript jquery json

我有一个Javascript类及其方法。但是当我把它称为toJSON时会产生错误。我无法弄清楚为什么会发生这种错误。

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 个答案:

答案 0 :(得分:2)

jQuery没有内置的JSON序列化,只有他们的最新版本检测本机JSON API并使用它们。

您寻求的toJSON()是jQuery插件的一部分。

如果没有别的话,我会使用JSON2