建立一个网站使用fullcalendar。

时间:2022-01-03 10:08:43

I am trying to set up a page with a calendar, my problem is that i am not sure how to organizr the inclussions so that i dont get errors, here is my <head>

我试图用一个日历建立一个页面,我的问题是,我不知道如何组织这些倾斜,这样我就不会出错,这是我的。

<head runat="server">
    <title></title>
    <link href="~/Styles/Site.css" rel="stylesheet" type="text/css" />
    <link href="fullcalendar/fullcalendar.css" rel="stylesheet" type="text/css" />
    <script src="jquery/jquery-1.8.1.min.js" type="text/javascript"></script>
    <script src="fullcalendar/fullcalendar.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {

            // page is now ready, initialize the calendar...

            $('#calendar').fullCalendar({
                // put your options and callbacks here
            })

        });
    </script>
    <asp:ContentPlaceHolder ID="HeadContent" runat="server">
    </asp:ContentPlaceHolder>
</head>

When my page starts, i get an error that says Microsoft JScript runtime error: '$' is undefined and it highlights the whole jquery in yellow (its a popup with the error). What can i do to avoid the error?, i am registering jquery as you can see, so not sure why that error comes up.

当我的页面启动时,我得到一个错误,它说Microsoft JScript运行时错误:“$”是未定义的,它突出显示了整个jquery的黄色(它是一个弹出的错误)。我能做些什么来避免错误呢?您可以看到,我正在注册jquery,所以不知道为什么会出现这个错误。

Thank you I grately appreciate your help.

谢谢你的帮助。

1 个解决方案

#1


1  

The code seems okay.Only problem I think your reference to jquery library is not right.See the source code and click on the jquery library including line to test whether the path is fine or not. Keep the jquery-1.8.1.min.js on the same folder where these php files are or use any CDN libray like

代码看起来好。我认为您对jquery库的引用是不正确的。查看源代码并单击jquery库,其中包括行来测试路径是否正确。保持jquery-1.8.1.min。在相同的文件夹中,这些php文件或使用任何CDN类库。

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>

If it would't work, use noConflict() to fix it:

如果它不能工作,请使用noConflict()来修复它:

   <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
   <script type="text/javascript">
        var temp = jQuery.noConflict();
        temp(document).ready(function () {

            // page is now ready, initialize the calendar...

            temp('#calendar').fullCalendar({
                // put your options and callbacks here
            })

        });
    </script>

Hope it helps !!

希望它帮助! !

#1


1  

The code seems okay.Only problem I think your reference to jquery library is not right.See the source code and click on the jquery library including line to test whether the path is fine or not. Keep the jquery-1.8.1.min.js on the same folder where these php files are or use any CDN libray like

代码看起来好。我认为您对jquery库的引用是不正确的。查看源代码并单击jquery库,其中包括行来测试路径是否正确。保持jquery-1.8.1.min。在相同的文件夹中,这些php文件或使用任何CDN类库。

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>

If it would't work, use noConflict() to fix it:

如果它不能工作,请使用noConflict()来修复它:

   <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
   <script type="text/javascript">
        var temp = jQuery.noConflict();
        temp(document).ready(function () {

            // page is now ready, initialize the calendar...

            temp('#calendar').fullCalendar({
                // put your options and callbacks here
            })

        });
    </script>

Hope it helps !!

希望它帮助! !