未捕获的ReferenceError:未定义deleteAttachment

时间:2014-06-16 19:27:15

标签: javascript html ajax web

我收到一条未捕获的ReferenceError:尝试调用此函数时未定义deleteAttachment:

function deleteAttachment() {
    var node = $("#attachments").fancytree("getActiveNode");
    var key = node.key;
    var folderId = document.getElementById("folderId") ? document.getElementById("folderId").value : "";

    var request = $.ajax({
        url : "attachmentsAjax",
        dataType : "json",
        type : "post",
        data : {
            action : "deleteAttachment",
            "key" : key,
             "folderId" : folderId
        }
    });

HTML:

        <input type="button"  name="deleteAttachment" value="Delete Attachment" onclick="deleteAttachment();" />

我错过了什么?

0 个答案:

没有答案