下面的代码:jQuery函数没有找到
// also tried function getDeletedDates()
var getDeletedDates = function()
{
var s = new Array();
$(".deleted").each(function(i, e) {
s.push($(e).attr("data-day"));
});
};
$(function()
{
$("#delete_send").click(function() {
alert("drin");
$.ajax({
url: "delete.php",
type: "POST",
data: ({deleteDates : getDeletedDates()}),
dataType: "json",
success: function(msg){
alert(msg);
},
beforeSend: function(){
alert("Lösche folgende Urlaubstage: "+ getDeletedDates().join(", "));
},
error: function(x, s, e) {
alert("Fehler: " + s);
}
}
);
});
});
但我接触到beforeSend
()他总是说“getDeletedDates
()未定义” 这是为什么,我宣布全球范围内的功能?
在此先感谢。
喔谢谢你帮, 但我很困惑,为什么它说:“getDeletedDates()是未定义” 但非常感谢你! – 2010-07-21 07:03:00
所以接受答案。 – Cipi 2010-07-21 07:03:49
查看为什么更新的答案。 – 2010-07-21 08:19:23