Greetings,
I've been with this about 1 or 2 hours and it seems I cannot find the error in this function I've created to check the availability of something in a Database through jQuery and Ajax.
I'm calling the function with this link for test purpouses since I were unable to catch any errors before.
<a href="#" onclick="availability_check("Despacho", "22/05/2011","12:30", "12:45")">TEST</a>
And the code of the Function is the following:
function availability_check(location, date, from, to){
var check = 'location='+ location + '&date='+ date + '&from=' + from + '&to=' + to;
$.ajax({
type: "POST",
url: "check-availability.php",
data: check,
cache: false,
success: function(response){
var available = response;
}
});
return available;
}
Declared just under the document_ready function.
Could someone smarter than me tell me what's wrong? Firebug just says:
3
syntax error [Stop in this error] availability_check(