I'm trying to load a json events feed into the FullCalendar jQuery plugin, however, I don't understand how to pass the data into FullCalendar. The url is called, and the JSON object is available inside the eventHandler function.
The code below attempts to pass the resulting data into a global variable (which, doesn't feel right), which is then passed into FullCalendar.
What is the right way to pass the data from the request into FullCalendar?
function eventHandler(data) {
events = data;
}
$.ajax({
dataType: 'jsonp',
url: 'http://localhost:9393/events/calendar/1.json',
jsonp: 'callback',
success: eventHandler
});