当我添加标题(例如我的生日日历)时,停止加载

这是我的脚本:

$('#calendar').fullCalendar({
    header: {
        left: 'prev,next today',
        center: 'title',
        right: 'month,basicWeek,basicDay,listMonth'
    },
    weekNumbers: true,
    editable: true,
    eventLimit: true, // allow "more" link when too many events
    selectable: true,
    selectHelper: true,
    //Select function
    //Event render
    //Event drop
    //Event resize
    events: [
    <?php foreach($events as $event):
       //Fetch data dynamically
       title: '<?php echo $event['title']; ?>',
    <?php endforeach; ?>
    ]
});


我能怎么做?

最佳答案

是的,因为单引号似乎结束了您的字符串。您应该尝试转义特殊字符。您可以尝试以下方法:

title : 'my\'s Birthday'

要么
title : "my's Birthday"

要么
title : 'my&quot;s Birthday'

关于javascript - 当发现特殊字符时,FullCalendar停止加载,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/54264626/

10-11 23:27
查看更多