[英]datePicker jquery plugin not properly load
I'm trying to use the following plugin for date picking:我正在尝试使用以下插件进行日期选择:
http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/index.html http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/index.html
And I'm trying to use the code from the first demo but I get an error that jQuery is not defined (last line of the plugin, where the function is closed).我正在尝试使用第一个演示中的代码,但我收到一个错误,指出 jQuery 未定义(插件的最后一行,该函数已关闭)。
I haven't used jQuery before so I'm hoping this is a simple error.我之前没有使用过 jQuery,所以我希望这是一个简单的错误。
I've tried to call it as follows:我试过这样称呼它:
<script type="text/javascript" charset="utf-8">
$(function () {
$('.date-pick').datePicker();
}
</script>
^ Inside the head of the page. ^ 在页面的头部内部。 There is also another jQuery code in the head, could this be causing a problem?头部还有另一个 jQuery 代码,这会导致问题吗?
The plugin and other required JS are all present.插件和其他所需的 JS 都存在。
Adam亚当
Try this:试试这个:
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
$('.date-pick').datePicker();
})
</script>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.