5
我无法使用Jquery将新事件添加到fullCalendar。我使用Eclipse开发Web,并且完全不熟悉Ajax,它不适用于我的eclipse。使用Jquery动态插入事件到Fullcalendar
所有内容都写在jquery中的button.click函数中。
var subject = $("#txtEventName").val(); //the title of the event
var dateStart = $("#txtDate").val(); //the day the event takes place
var dateEnd = $("#txtDateEnd").val(); //the day the event finishes
var allDay = $("#alldayCheckbox").val(); //true: event all day, False:event from time to time
var events=new Array();
event = new Object();
event.title = subject;
event.start = dateStart; // its a date string
event.end = dateEnd; // its a date string.
event.color = "blue";
event.allDay = false;
events.push(event);
$('#calendar').fullCalendar('addEventSource',events);
未检测到错误但未创建事件。 P.S:如果没有其他方式在jQuery中,我想留在数组中。
“事件”是Javascript中的保留字,所以在代码中更改“事件”对象名称,它可能工作。 –
@Furqan我做到了,还没有工作:( –
哪些.js文件包含在您的HTML中? – ganeshk