I am trying to get data from db using ajax. When a date is selected from inline calender then that date will be captured and query will be done and ive to show the holiday status of the selected date. but the ajax request is not working, how to know whether it is working or not.
my code is
$(function () {
$("#divCalendar").datepicker({
dateFormat: "mm-dd-yy",
onSelect: function (selectedDate) {
//alert("You clicked on " + selectedDate.toString());
var dataString = 'sdt='+ selectedDate.toString();
//alert("You clicked on " + dataString);
$.ajax({
type: "POST",
url:"demotest.php",
data: dataString,
dataType : "json",
success:function(data){
if(data != "ERROR")
{
$("#div1").html(data);
}
else
{
$("#div1").html("nothing found");
}
}
});
}
});
});