I was wondering if there's a way to get "event" from ajax success? For example:
UPDATE:
$.ajax({
type: "GET",
url: "/home/PersonInfo",
dataType: "json",
success: function(data) {
// I would like to use "data" like data.name, is this possible?
}
});
to
function MyEvents(start, end, callback) {
$.ajax({
type: "GET",
url: "/home/GetInfo",
dataType: "json",
success: function(data) {
alert(data[0].start);
var events = [];
var meeting = new Date((data[0].start).getFullYear(),
(data[0].start).getMonth(),
(data[0].start).getDate());
while (meeting <= data[0].end) {
events.push({
id: data[0].id,
title: data[0].title,
start: new Date(meeting.valueOf()),
allDay: false
});
// increase by one week
meeting.setDate(meeting.getDate() + 7);
}
callback(events);
}
});
}
data[0].start).getFullYear() is not a function? this is the json returned: [{"start":1277985600,"end":1278158400}] Can anyone help?