jquery timepicker throws:Uncaught TypeError 即使在包含必要的文件之后

jquery timepicker throws:Uncaught TypeError even after including the necessary files

我正在尝试调用 timepicker 函数,但它不断抛出:

未捕获类型错误:jQuery(...).timepicker 不是函数(...)

我看到文件已加载到网络中,但无法访问时间选择器 function.I 在此文件加载之前还加载了 jquery 和 jquery-ui。 以下是我如何包含脚本:

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-timepicker/1.8.9/jquery.timepicker.js"></script>

js:

    $("#timestart").timepicker();

html:

<label>Start Date</label>
<input type="text" id="timestart"/>

我一直在努力找出我哪里出错了。任何线索为什么无法访问 timepicker 函数并抛出错误?

谢谢!

您是否也包含 jquery.timepicker.css 文件?

我在此 working fiddle 中使用了您的相同代码。

<label>Start Date</label>
<input type="text" id="timestart"/>

 $("#timestart").timepicker();