0

嗨,我正在尝试实现一个基本的时间选择器示例,我遇到: 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>
4

2 回答 2

2

优先级顺序必须如下:

  1. jQuery.js
  2. 一切都依赖于 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>
于 2013-06-05T17:22:41.837 回答
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>
于 2013-06-05T17:23:14.340 回答