JQuery function not found
<pre><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);
                  }
               }
            );
        });
    });
</code></pre>

<p>But i come into <code>beforeSend</code>() he always says "<code>getDeletedDates</code>() undefined"
Why is this, i declared the function in global scope?</p>

<p>thanks in advance.</p>
