我收到一条未捕获的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();" />
我错过了什么?