JavaScript运行时错误,jQuery未定义

时间:2013-12-10 02:40:26

标签: javascript

当我向我的aspx门户添加fullcalendar时,运行visual studio 2010 show:

JavaScript runtime error,not define jQuery.

这是portal.aspx代码:

<script type="text/javascript" src="../images/HomeImage/PicNews/calendar/fullcalendar.js"></script>
    <link rel="stylesheet" href="../images/HomeImage/PicNews/calendar/jquery-ui.min.css" />
    <link href="../images/HomeImage/PicNews/calendar/fullcalendar.css" rel="stylesheet" />
    <link href="../images/HomeImage/PicNews/calendar/fullcalendar.print.css" rel="stylesheet" media="print" />
    <script type="text/javascript" src="../images/HomeImage/PicNews/calendar/jquery.min.js"></script>
    <script type="text/javascript" src="../images/HomeImage/PicNews/calendar/jquery-ui.custom.min.js"></script>
    <script type="text/javascript" src="../images/HomeImage/PicNews/calendar/fullcalendar.min.js"></script>
    <script type="text/javascript" src="../images/HomeImage/PicNews/calendar/jquery.min.js">
        $(document).ready(function () {

            var date = new Date();
            var d = date.getDate();
            var m = date.getMonth();
            var y = date.getFullYear();

            $('#calendar').fullCalendar({
                theme: true,
                header: {
                    left: 'prev,next today',
                    center: 'title',
                    right: 'month,agendaWeek,agendaDay'
                },
                editable: true,
                events: [
                {
                    title: 'All Day Event',
                    start: new Date(y, m, 1)
                },
                {
                    title: 'Long Event',
                    start: new Date(y, m, d - 5),
                    end: new Date(y, m, d - 2)
                },
                {
                    id: 999,
                    title: 'Repeating Event',
                    start: new Date(y, m, d - 3, 16, 0),
                    allDay: false
                },
                {
                    id: 999,
                    title: 'Repeating Event',
                    start: new Date(y, m, d + 4, 16, 0),
                    allDay: false
                },
                {
                    title: 'Meeting',
                    start: new Date(y, m, d, 10, 30),
                    allDay: false
                },
                {
                    title: 'Lunch',
                    start: new Date(y, m, d, 12, 0),
                    end: new Date(y, m, d, 14, 0),
                    allDay: false
                },
                {
                    title: 'Birthday Party',
                    start: new Date(y, m, d + 1, 19, 0),
                    end: new Date(y, m, d + 1, 22, 30),
                    allDay: false
                },
                {
                    title: 'Click for Google',
                    start: new Date(y, m, 28),
                    end: new Date(y, m, 29),
                    url: 'http://google.com/'
                }
            ]
            });
        });
    </script>

这是js文件中出现错误的地方:

(function($, undefined) {


;;

var defaults = {

    // display
    defaultView: 'month',
    aspectRatio: 1.35,
    header: {
        left: 'title',
        center: '',
        right: 'today prev,next'
    },
    weekends: true,
    weekNumbers: false,
    weekNumberCalculation: 'iso',
    weekNumberTitle: 'W',

1 个答案:

答案 0 :(得分:1)

您可能需要在日历引用之前放置jquery引用。由于您将其包含两次,只需删除第一个引用(包含代码的第一行。

<script type="text/javascript" src="../images/HomeImage/PicNews/calendar/fullcalendar.js"></script>