我有两个无法在我的页面上运行的 jQuery 脚本、一个验证脚本和一个时间选择器。他们根本不工作,但是 datepicker 工作。时间选择器出现以下错误:
未捕获的类型错误:对象 [object Object] 没有方法“timepicker”
然而,这是我得到的唯一错误。
这是我正在使用的代码:
<script src="/js/jquery-1.10.1.js"></script>
<script src="/js/jquery-ui-1.10.3.custom.js"></script>
<script src='/sorttable.js'></script>
<script src="/js/jquery.ui.timepicker.js"></script>
<script src="/jquery.validate.js"></script>
<link rel="stylesheet" type="text/css" href="/assets/css/appmanager.css">
<link rel="stylesheet" href="/css/overcast/jquery-ui-1.10.3.custom.css" />
<link rel="stylesheet" href="/js/jquery.ui.timepicker.css" />
<script >
jQuery(document).ready(function() {
jQuery(".content").hide();
//toggle the componenet with class msg_body
jQuery(".heading").click(function()
{
jQuery(this).next(".content").slideToggle(500);
});
});
</script>
<script>
jQuery(document).ready(function($){
$("#datepicker").datepicker();
});
</script>
<script>
jQuery(document).ready(function($){
$( "#datepicker1" ).datepicker();
});
</script>
<script type="text/javascript">
$(document).ready(function() {
$('#timepicker').timepicker( {
showAnim: 'blind'
} );
});
</script>
<script>
$().ready(function() {
$("#newapp").validate({
rules: {
facility: {
required: true,
minlength: 3
},
disclaimer: {
required: true,
},
department: {
required: true,
minlength: 3
},
address: {
required: true
},
requestor: {
required: true,
minlength: 2
},
callback: {
required: true,
minlength: 7
},
language: "required"
},
messages: {
facility: {
required: "Please enter a facility",
minlength: "Facility name must be at least 3 characters"
},
department: {
required: "Please enter a department",
minlength: "Department name must be at least 3 characters"
},
address: {
required: "Please enter a address",
minlength: "Address must be at least 5 characters"
},
requestor: {
required: "Please enter a requestor",
minlength: "Requestor name must be at least 3 characters"
},
callback: {
required: "Please enter a callback number",
minlength: "Callback number must be at least 7 characters"
},
language: {
required: "Please enter a language"
}
}
});
});
</script>
和 HTML:
<p>Date: <input type="text" style="width:100px;" id="datepicker" name="date" value=""/>
Time :<input id="timepicker" class="hasTimepicker" type="text" value="" name="time" style="width: 70px;"></input></p>
<p>Client (Other): <input type="text" style="width:173px;" id="client" name="clientother" value=""/></p>
<p>Facility: <input type="text" style="width:215px;" id="facility" name="facility" value=""/></p>
<p>Department: <input type="text" style="width:186px;" id="department" name="department" value=""/></p>
<p>Address: <input type="text" style="width:210px;" id="address" name="address" value=""/></p>
<p>Requestor: <input type="text" style="width:197px;" id="requestor" name="requestor" value=""/></p>
<p>Provider: <input type="text" style="width:210px;" id="provider" name="provider" value=""/></p>
<p>Callback #: <input type="text" style="width:198px;" id="callback" name="callback" value=""/></p>
</div>
<div style="Float:right; width:50%">
<p>Language: <input type="text" style="width:210px;" id="language" name="language" value=""/></p>
<p>Medicaid: <select name="medicaid" style="width:225px;" id="medicaid">
<option value="1">No Medicaid</option>
<option value="2">Primary Medicaid</option>
<option value="3">Seccondary Medicaid</option></select></p>
<p>Medicaid ID: <input type="text" style="width:194px;" id="medicaidid" name="medicaidid" value=""/></p>
<p>LES Name: <input type="text" style="width:209px;" id="name" name="name" value=""/></p>
<p>LES Date of Birth: <input type="text" style="width:167px;" id="dob" name="dob" value=""/> </p>
<p>Notes: <textarea rows="6" name= "notes" cols="80" id="notes" style="width:242px"></textarea></p>
<input type="hidden" id="createdby" name="createdby" value"<?php echo $_SESSION['jigowatt']['username']; ?>" />
知道我错过了什么吗?