Fullcalendar 完整日历跨域问题
我正在尝试在本地主机上设置FullCalendar以进行测试。代码如下:Fullcalendar 完整日历跨域问题,fullcalendar,cors,crossdomain.xml,Fullcalendar,Cors,Crossdomain.xml,我正在尝试在本地主机上设置FullCalendar以进行测试。代码如下: $( '.calendar' ).fullCalendar( { header: { left: 'prev,next today', center: 'title', right: 'month,agendaWeek,agendaDay' }, eventSources: [ { url: "http://ww
$( '.calendar' ).fullCalendar( {
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
eventSources: [
{
url: "http://www.google.com/calendar/feeds/feed_one",
className: 'feed_one'
},
{
url: "http://www.google.com/calendar/feeds/feed_two",
className: 'feed_two'
]
} )
相反,我在控制台中遇到此错误,并且不会显示事件:
XMLHttpRequest cannot load http://www.google.com/calendar/feeds/feed_one.
Origin http://localhost is not allowed by Access-Control-Allow-Origin. localhost:1
XMLHttpRequest cannot load http://www.google.com/calendar/feeds/feed_two.
Origin http://localhost is not allowed by Access-Control-Allow-Origin. localhost:1
从我的研究来看,这似乎是一个跨来源资源共享的问题,但我不知道如何解决它
如果有人能帮我,或者给我指出正确的方向,我将不胜感激。您需要提出跨域访问的JSONP请求。请您设置以下属性,并检查是否适合您
您可以通过以下方式获得JSONP的详细描述
我有这个问题。在添加到代码
后,它已被修复。谢谢。这似乎解决了这个错误。但是,日历仍然不显示任何事件。有没有想过如何测试以确定问题所在?我缺少此文件引用,添加它修复了问题。我在尝试使用此类库时发现了相同的错误。之后我添加了上面描述的内容,错误消失了。这样的故障排除也帮助了一些人。所以不是我的疑难解答,而是你的评论无关。
eventSources: [
{
url: "http://www.google.com/calendar/feeds/feed_one",
dataType : 'jsonp',
className: 'feed_one'
},
{
url: "http://www.google.com/calendar/feeds/feed_two",
dataType : 'jsonp',
className: 'feed_two',
]