gpt4 book ai didi

javascript - Fullcalendar 不能在 Windows 机器上的 FF 中工作

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:46:53 24 4
gpt4 key购买 nike

我在将外部元素拖放到 Windows 机器上的日历 (Fullcalendar) 时遇到问题。在 linux、mac 机器上一切正常。但不会保存到 Windows 机器上的数据库中。可能是什么问题??

jQuery(document).ready(function() {

/* initialize the external events
-----------------------------------------------------------------
*/

jQuery('#external-events div.external-event').each(function() {

// create an Event Object (http://arshaw.com/fullcalendar/docs/event_data/Event_Object/)
// it doesn't need to have a start or end
var eventObject = {
title: jQuery.trim(jQuery(this).text()) // use the element's text as the event title
};

// store the Event Object in the DOM element so we can get to it later
jQuery(this).data('eventObject', eventObject);

// make the event draggable using jQuery UI
jQuery(this).draggable({
zIndex: 999,
revert: true, // will cause the event to go back to its
revertDuration: 0 // original position after the drag
});
});

// page is now ready, initialize the calendar...
jQuery('#calendar').fullCalendar({

loading: function(bool) {
if (bool) jQuery('#loading').show();
else jQuery('#loading').hide();
},

events: "/roster/manage/ajax?part=shiftcalendar&nodeID="+placeid,


// put your options and callbacks here
header: {
left: 'prev,next today',
center: 'title',
right: 'prev,next today',
},

cache: false,
editable: true,
droppable: true, // this allows things to be dropped onto the calendar !!!
drop: function(date, allDay) { // this function is called when something is dropped

// retrieve the dropped element's stored Event Object
var originalEventObject = jQuery(this).data('eventObject');

// we need to copy it, so that multiple events don't have a reference to the same object
var copiedEventObject = jQuery.extend({}, originalEventObject);

// assign it the date that was reported
copiedEventObject.start = date;
copiedEventObject.allDay = allDay;

// render the event on the calendar
// the last `true` argument determines if the event "sticks" (http://arshaw.com/fullcalendar/docs/event_rendering/renderEvent/)
jQuery('#calendar').fullCalendar('renderEvent', copiedEventObject, true);

// Call this function to store the date and time of this shift into a table
saveShift(originalEventObject,copiedEventObject);
},

eventDrop: function(event,dayDelta,minuteDelta,allDay,revertFunc) {

if (!confirm("Are you sure you want to change dates?")) {
revertFunc();
}
else {
// Our edit function for this shift
updateShift(event);
}
},

eventClick: function(event,revertFunc) {
if(!confirm("Are you sure you want to delete this "+ event.title +" shift?")) {
revertFunc();
}
else {
// Delete shift
deleteShift(event);
}
}


/*eventMouseover: function(event, jsEvent, view) {

jQuery.getJSON('/roster/manage/ajax', {part: "shiftcalendarpeople", shiftID: event.id }, function(data) {
if(data != null) {
var layer = "<div id='events_"+event.id+"'>";
jQuery.each(data, function(k, v) {
layer += "<span>"+v.user+" as "+v.role+"</span>";
});
layer += "</div>";
jQuery(this).append(layer);
}
else {

var layer = "<div id='events_"+event.id+"'><span>No people rostered.</span></div>";
jQuery(this).append(layer);
}
});

},

eventMouseout: function(event, jsEvent, view) {
jQuery("#events_"+event.id+"").remove();
}*/

})
});

最佳答案

通常,当某些东西在除 Windows 以外的每台机器上都能正常工作时(反之亦然),这是因为路径问题。我看到你在变量中使用了 unix 路径

事件:“/roster/manage/ajax?part=shiftcalendar&nodeID="+placeid

也许尝试使用 Windows 样式路径 "\roster\manage\ajax?part=shiftcalendar&nodeID="+placeid

这是一个粗略的猜测。这就是我第一眼看到的东西。

关于javascript - Fullcalendar 不能在 Windows 机器上的 FF 中工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8048302/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com