这是我的代码。它适用于获取数据和解析,但我无法显示事件。请让我知道可能的原因。
我觉得回调(事件)在这里不起作用。
events: function(callback)
{
$.ajax({
type: "POST",
url: "WebService.asmx/hello",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(data)
{
var evnt = [];
$(data.d).find('event').each(function()
{
evnt.push({
// title: $(this).attr('title'),
// start: $(this).attr('start'),
// end: $(this).attr('end')
title: 'Events1',
start: '2010-04-01',
end: '2010-04-10'
});
});
alert('called end');
callback(evnt);
},
error: OnError
});
}