您好,我正在尝试实现一个基本的timepicker示例,我遇到:
Uncaught Type Error: Object[object Object] has no method timepicker
代码:
<!DOCTYPE html>
<html>
<head>
<link type="text/css" href="js/jquery.ui.timepicker.css" rel="stylesheet" />
<!--<script type="text/javascript" src="js/jquery.ui.timepicker.js"></script>-->
<script type="text/javascript" src="js/jquery.timepicker.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#id1').timepicker();
});
</script>
</head>
<body>
Input: <input id="id1" type="text" name="fullname"><br>
</body>
</html>
答案 0 :(得分:2)
优先顺序必须如下:
看起来你错了(在问题中查看你的代码)。将其更改为:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.timepicker.min.js"></script>
答案 1 :(得分:0)
首先加载jQuery!
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.timepicker.min.js"></script>