加载时为FullCalendar,>未捕获的TypeError:无法读取未定义的属性“推" [英] FullCalendar on loading > Uncaught TypeError: Cannot read property 'push' of undefined

查看:106
本文介绍了加载时为FullCalendar,>未捕获的TypeError:无法读取未定义的属性“推"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,感谢您的协助. 我只是在我的开发环境中加载FullCalendar( https://fullcalendar.io/),但它没有似乎有效.

当我在Chrome上打开控制台时,出现以下问题.

Uncaught TypeError: Cannot read property 'push' of undefined
    at fullcalendar.min.js:6
    at fullcalendar.min.js:6
    at fullcalendar.min.js:6

我什至还没有调用/声明脚本,这使我感到困惑.

代码减少到以下要点.谢谢

<!DOCTYPE html>
<html lang="en">

    <head>
        <title>Home</title>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="">

        <!-- CSS -->
        <link href="http://localhost/dev/assets/third-party/css/styles.css" rel="stylesheet">
        <link href="http://localhost/dev/assets/third-party/css/skins/indianred.css" rel="stylesheet">
        <link href='//cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.2.0/fullcalendar.min.css' rel='stylesheet' />
        <link href='//cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.2.0/fullcalendar.print.css' rel='stylesheet' media='print' />

    </head>
    <body>
        <!-- WRAPPER -->
        <div class="wrapper">
            <div id="calendar"></div>

        </div>
        <!-- END WRAPPER -->
        <!-- JAVASCRIPTS -->
        <script src='http://localhost/dev/assets/third-party/js/jquery-2.1.1.min.js'></script>
        <script src='http://localhost/dev/assets/third-party/js/bootstrap.min.js'></script>
        <script src='http://localhost/dev/assets/third-party/js/repute-scripts.js'></script>
        <script src="//cdnjs.cloudflare.com/ajax/libs/1000hz-bootstrap-validator/0.11.9/validator.min.js"></script>
        <script src='http://localhost/dev/assets/third-party/js/plugins/moment/moment.min.js'></script>
        <script src='http://localhost/dev/assets/third-party/js/plugins/fullcalendar/fullcalendar.min.js'></script>
        <script src="http://localhost/dev/assets/js/b/result.js"></script>
        <script src="http://localhost/dev/assets/js/b/event.js"></script>
        <script src="http://localhost/dev/assets/js/b/bapp.js"></script>
        <script>
            $(function() {
                var bapp = new Bapp();
            });
        </script>
        <!-- END JAVASCRIPTS -->
    </body>
</html>

解决方案

我有相同的错误消息,因为我使用的是不支持moment.momentPropertiesmoment版本.如果您指向fullcalendar.js而不是最小版本,错误消息中的行号将帮助您查看错误是否源自同一问题.我通过从fullcalendar下载zip文件并指向其中包含的moment.min.js文件来修复它.我正在使用moment version 2.0.0. fullcalendar(今天下载)中包含的版本是2.18.1.

thanks for tyour assistance first of all. I'm simply loading FullCalendar (https://fullcalendar.io/) on my dev environemts but it doesn't seem to work.

When I open the console on Chrome it gives me the following issue.

Uncaught TypeError: Cannot read property 'push' of undefined
    at fullcalendar.min.js:6
    at fullcalendar.min.js:6
    at fullcalendar.min.js:6

I haven't even called/declared the script yet and this puzzles me.

Code cut down to the essential below. Thank you

<!DOCTYPE html>
<html lang="en">

    <head>
        <title>Home</title>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="">

        <!-- CSS -->
        <link href="http://localhost/dev/assets/third-party/css/styles.css" rel="stylesheet">
        <link href="http://localhost/dev/assets/third-party/css/skins/indianred.css" rel="stylesheet">
        <link href='//cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.2.0/fullcalendar.min.css' rel='stylesheet' />
        <link href='//cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.2.0/fullcalendar.print.css' rel='stylesheet' media='print' />

    </head>
    <body>
        <!-- WRAPPER -->
        <div class="wrapper">
            <div id="calendar"></div>

        </div>
        <!-- END WRAPPER -->
        <!-- JAVASCRIPTS -->
        <script src='http://localhost/dev/assets/third-party/js/jquery-2.1.1.min.js'></script>
        <script src='http://localhost/dev/assets/third-party/js/bootstrap.min.js'></script>
        <script src='http://localhost/dev/assets/third-party/js/repute-scripts.js'></script>
        <script src="//cdnjs.cloudflare.com/ajax/libs/1000hz-bootstrap-validator/0.11.9/validator.min.js"></script>
        <script src='http://localhost/dev/assets/third-party/js/plugins/moment/moment.min.js'></script>
        <script src='http://localhost/dev/assets/third-party/js/plugins/fullcalendar/fullcalendar.min.js'></script>
        <script src="http://localhost/dev/assets/js/b/result.js"></script>
        <script src="http://localhost/dev/assets/js/b/event.js"></script>
        <script src="http://localhost/dev/assets/js/b/bapp.js"></script>
        <script>
            $(function() {
                var bapp = new Bapp();
            });
        </script>
        <!-- END JAVASCRIPTS -->
    </body>
</html>

解决方案

I had the same error message because I using a version of moment that didn't support moment.momentProperties. If you point to fullcalendar.js instead of the min version, the line numbers in the error message will help you see whether or not the error originated from the same issue. I fixed it by downloading the zip file from fullcalendar and pointing to the moment.min.js file included there. I was using moment version 2.0.0. The version included from fullcalendar (downloaded today) was 2.18.1.

这篇关于加载时为FullCalendar,&gt;未捕获的TypeError:无法读取未定义的属性“推"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆