Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Fullcalendar-Ajax未在IE8中发布_Php_Jquery_Ajax_Internet Explorer 8_Fullcalendar - Fatal编程技术网

Php Fullcalendar-Ajax未在IE8中发布

Php Fullcalendar-Ajax未在IE8中发布,php,jquery,ajax,internet-explorer-8,fullcalendar,Php,Jquery,Ajax,Internet Explorer 8,Fullcalendar,大家好,我正试图为我工作的公司编写一个php内部网,但我遇到了这个问题: IE8用户在添加一个事件的当天,点击该事件询问所有问题,但不会在MySQL数据库中发布任何内容,但会在稍后的IE、FF和Chrome上发布 这是密码 $(文档).ready(函数(){ var user=''; 变量日期=新日期(); var d=date.getDate(); var m=date.getMonth(); var y=date.getFullYear(); var calendar=$(“#calenda

大家好,我正试图为我工作的公司编写一个php内部网,但我遇到了这个问题:

IE8用户在添加一个事件的当天,点击该事件询问所有问题,但不会在MySQL数据库中发布任何内容,但会在稍后的IE、FF和Chrome上发布

这是密码
$(文档).ready(函数(){
var user='';
变量日期=新日期();
var d=date.getDate();
var m=date.getMonth();
var y=date.getFullYear();
var calendar=$(“#calendar”).fullCalendar({
是的,
标题:{
左:“上一个,下一个今天”,
中心:'标题',
右图:“月,agendaWeek,agendaDay”
},
事件:“../web\u assets/calendar/events.php”,
数据:“用户=”+用户,
类型:“POST”,
//将全天从字符串转换为布尔值
eventRender:函数(事件、元素、视图){
如果(event.allDay=='true'){
event.allDay=true;
}否则{
event.allDay=false;
}
},
是的,
selectHelper:对,
//将事件添加到日历
选择:功能(开始、结束、全天){
var title=prompt('事件标题:');
var url=prompt('Type Event url,如果退出:');
如果(标题){
start=$.fullCalendar.formatDate(开始,“yyyy-MM-dd HH:MM:ss”);
end=$.fullCalendar.formatDate(end,“yyyy-MM-dd HH:MM:ss”);
$.ajax({
url:“../web_assets/calendar/add_events.php”,
数据:'title='+title+'&owner='+user+'&start='+start+'&end='+end+'&url='+url,
类型:“POST”,
成功:函数(json){
警报(“添加成功”);
}
});
日历。完整日历('renderEvent',
{
标题:标题,,
开始:开始,
完:完,,
全天
},
true//使事件“持续”
);
}
日历。完整日历(“取消选择”);
},
//更新日历上的事件(移动项目)
是的,
eventDrop:函数(事件,增量){
start=$.fullCalendar.formatDate(event.start,“yyyy-MM-dd HH:MM:ss”);
end=$.fullCalendar.formatDate(event.end,“yyyy-MM-dd HH:MM:ss”);
$.ajax({
url:“../web_assets/calendar/update_events.php”,
数据:'title='+event.title+'&start='+start+'&end='+end+'&id='+event.id,
类型:“POST”,
成功:函数(json){
警报(“更新成功”);
}
});
},
//事件更新(调整事件大小)
eventResize:函数(事件){
start=$.fullCalendar.formatDate(event.start,“yyyy-MM-dd HH:MM:ss”);
end=$.fullCalendar.formatDate(event.end,“yyyy-MM-dd HH:MM:ss”);
$.ajax({
url:“../web_assets/calendar/update_events.php”,
数据:'title='+event.title+'&start='+start+'&end='+end+'&id='+event.id,
类型:“POST”,
成功:函数(json){
警报(“更新成功”);
}
});
}
});
});
如果有人能解决这个问题,你会让我高兴的

编辑 我已经做了您建议的更改,您能告诉我为什么事件更新不起作用吗?
如果需要,我可以发布php PDO mysql语句…?

正如我在评论中所说的,首先检查一下小的拼写错误,因为IE8对它们非常敏感。 然后:

1.您有重复的声明
可编辑:true,

2.此处定义的两个变量没有
var
word:

eventDrop: function(event, delta) {
    start = $.fullCalendar.formatDate(event.start, "yyyy-MM-dd HH:mm:ss");
    end = $.fullCalendar.formatDate(event.end, "yyyy-MM-dd HH:mm:ss");
再来一次

eventResize: function(event) {
    start = $.fullCalendar.formatDate(event.start, "yyyy-MM-dd HH:mm:ss");
    end = $.fullCalendar.formatDate(event.end, "yyyy-MM-dd HH:mm:ss");
3.这样的数据编码是不安全的

data: 'title='+ event.title+'&start='+ start +'&end='+ end +'&id='+ event.id,
更好的是(jQuery将为您序列化它):

4.您还可以添加ajax错误回调,如

$.ajax({
    /* removed the rest of the code for simplicity */
    success: function(json) {
        alert('Added Successfully');
    },
    error: function () {
        alert('something went wrong');
    }
});
有关ajax设置的更多信息,请参见此处()


对不起,如果没有绝对后端链接,我将无法再为您提供帮助。

Internet Explorer对JavaScript中的拼写错误非常敏感,而其他浏览器可能会忽略任何小的拼写错误。因此,请仔细检查您的代码,它可能只是某个地方缺少的分号或逗号。请您帮助解释为什么事件更新无法在^^^^^^^^^^以上工作。好的,为了帮助您解决问题,我应该有可能复制它。不幸的是,如果不访问您的后端PHP服务器,我就无法做到这一点。你自己能做的就是按照我的建议,清理你的代码。然后将错误回调添加到AJAX调用中,以了解发生了什么。
data: {
    title: event.title,
    start: start,
    end: end,
    id: event.id
},
$.ajax({
    /* removed the rest of the code for simplicity */
    success: function(json) {
        alert('Added Successfully');
    },
    error: function () {
        alert('something went wrong');
    }
});