我遇到了很多困难(没有明显的原因)让jquery周历完全显示出来。
我链接到这些文件:
<link rel="stylesheet" href="/transporter/jquery-weekcalendar-1.2.2/jquery.weekcalendar.css">
<script type="text/javascript" src="/transporter/jquery-weekcalendar-1.2.2/jquery.weekcalendar.js"></script>
<script type="text/javascript src='/transporter/jquery-weekcalendar-1.2.2/jquery.weekcalendar.js.min.js"></script>
我按照这样开始我的日历:
$( "#eventscalendar" ).weekCalendar({
timeslotsPerHour : 4,
allowCalEventOverlap : true,
overlapEventsSeparate: true,
firstDayOfWeek : 1,
businessHours :{start: 8, end: 18, limitDisplay: true },
daysToShow : 7,
height : 300});
这是我的DIV:
<div
id="eventscalendar"
class="span11">
</div>
我看到的错误是:
Uncaught type error: [object Object] has no method 'weekCalendar'
我正在使用Bootstrap。问题是缺少CSS或JS引用,但我在演示中在线查找的代码对我来说根本不起作用。
JQuery Week Calendar不喜欢Bootstrap吗?我可能会在这里失踪什么?
感谢您提供任何有用的提示!
答案 0 :(得分:1)
错误的结束标记
看起来你首先没有加载jQuery
<script type="text/javascript 'src='/transporter/jquery-weekcalendar-1.2.2/jquery.weekcalendar.js.min.js"
^--------------
应该是
<script type="text/javascript" src="/transporter/jquery-weekcalendar-1.2.2/jquery.weekcalendar.js.min.js"
在使用jquery
jquery claender plugin
<link rel="stylesheet" href="/transporter/jquery-weekcalendar-1.2.2/jquery.weekcalendar.css">
// jQuery shold be loaded before you include your weekcalender plugin
<script type="text/javascript" src="/transporter/jquery-weekcalendar-1.2.2/jquery.weekcalendar.js.min.js"></script>
确保您只包含minified
或development
版本。但不是两个javascript文件。