following code:
// 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); } } ); }); });
But I enter beforeSend (), it always says " getDeletedDates () undefined" Why is this, I declared a function in the global scope?
early.
source share