这个错误对我的timepicker意味着什么?

时间:2011-12-15 17:24:32

标签: jquery timepicker

当我使用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
        });

        });

1 个答案:

答案 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>