您好我在使用完整日历时尝试使用模态对话框。
我的问题是我在尝试设置对话框时遇到此错误:
Uncaught TypeError: Object #<Object> has no method 'dialog'
<script>
$(document).ready(function() {
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
editable: true,
events:
{
url: 'testEvents.php',
type: 'POST',
data:
{
},
success: function(reply) {
console.log(reply);
},
error: function() {
alert('there was an error while fetching events!');
},
color: 'yellow', // a non-ajax option
textColor: 'black', // a non-ajax option
allDayDefault: false
}
,
eventClick: function(calEvent, jsEvent, view) {
//alert('Event: ' + calEvent.title);
$("#myModal").dialog({modal: true});
}
});
});
</script>
在HTML部分:
<body>
<div id='calendar'></div>
<div id="myModal" hidden="true">
Class name:
<br>
<input type="text" id="searchByFirstName">
<br>
Time:
<br>
<input type="text" id="searchByFirstName">
</div>
</body>
我已经阅读了jquery import的内容,但我没看到我的问题在哪里
我的进口商品:
<script src="//code.jquery.com/jquery-1.9.1.js"></script>
<link href='fullcalendar.css' rel='stylesheet' />
<link href='fullcalendar.print.css' rel='stylesheet' media='print' />
<script src='jquery.min.js'></script>
<script src='jquery-ui.custom.min.js'></script>
<script src='fullcalendar.min.js'></script>
答案 0 :(得分:1)
您只需要包含一次jQuery,以及您的自定义jQuery UI可能出现问题,尝试使用以下链接:
<link href='fullcalendar.css' rel='stylesheet' />
<link href='fullcalendar.print.css' rel='stylesheet' media='print' />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
<script src='fullcalendar.min.js'></script>