当我使用trent richardson的timepicker时,是否有人知道这些错误来自我的错误控制台?我需要做什么?
$ .timepicker未定义
jsfile中的这一行:$t.datepicker($.timepicker._newInst($t, o)._defaults);
$ .datepicker未定义
jsfile中的这一行:$.datepicker._base_selectDate = $.datepicker._selectDate;
trent richardson的jsfile:http://trentrichardson.com/examples/timepicker/js/jquery-ui-timepicker-addon.js
我的jsfile已被链接:
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<script type="text/javascript" src="jquery/jquery-1.7.min.js"></script>
<title>Prepare Questions and Answers</title>
<link rel="stylesheet" type="text/css" href="jquery/ui-lightness/jquery-ui-timepicker-addon.css"/>
<script type="text/javascript" src="jquery/jquery-ui-timepicker-addon.js"></script>
jquery代码:
$(function() {
$('#answerdurationpicker').timepicker({
timeFormat:'hh mm ss',
hourGrid: 4,
minuteGrid: 10,
secondGrid: 10,
showOn: 'button',
buttonImage: "Images/clock.gif",
buttonImageOnly: true
});
});
答案 0 :(得分:1)
我想你忘了包含jqueryui,这是一个与jquery不同的库。您应该在基本jquery之后包含它。您必须下载它并将代码修改为以下内容:
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<script type="text/javascript" src="jquery/jquery-1.7.min.js"></script>
<link rel="stylesheet" href="jquery/jquery-ui.css" type="text/css" />
<script type="text/javascript" src="jquery/jquery-ui.min.js"></script>
<title>Prepare Questions and Answers</title>
<link rel="stylesheet" type="text/css" href="jquery/ui-lightness/jquery-ui-timepicker-addon.css"/>
<script type="text/javascript" src="jquery/jquery-ui-timepicker-addon.js"></script>