How can I add a ajax call into my viewRender
?
For example:
var currentMonth = moment().month();
$('#calendar').fullCalendar({
viewRender: function(view, element){
url: '/getevents.php',
type: 'POST', // ERROR LINE
fail: function() {
alert('There was an error while fetching events.');
}
}
});
the error I get is this:
Uncaught SyntaxError: Unexpected token :
how can i fix this?