jQuery 日期选择器不工作
我正在尝试从 http://jqueryui.com/demos/datepicker/#default 实现 jQuery datepicker 。
该站点提供了我可以包含的各种 JS 和 CSS 文件。不过,我已经包含了以下标准 jQuery 文件。谁能告诉我除了这些标准文件之外还需要包含哪些内容?
<link href="/css/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
<link href="/css/jquerySliderOverride.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/javascript/jquery/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="/javascript/jquery/jquery-ui-1.8.7.custom.min.js"></script>
事实上,没有日历出现。这是我的标记:
<script type="text/javascript">
$(function () {
$("#<%= DateTextBox.ClientID %>datepicker").datepicker();
});
</script>
并且...
<div class="demo"><asp:textbox runat="server" id="DateTextBox" /></div>
I'm trying to implement the jQuery datepicker from http://jqueryui.com/demos/datepicker/#default.
This site provides various JS and CSS files that I can include. However, I'm already including the following standard jQuery files. Can anyone tell me what needs to be included beyond these standard files?
<link href="/css/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
<link href="/css/jquerySliderOverride.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/javascript/jquery/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="/javascript/jquery/jquery-ui-1.8.7.custom.min.js"></script>
As it is, no calendar appears. Here's my markup:
<script type="text/javascript">
$(function () {
$("#<%= DateTextBox.ClientID %>datepicker").datepicker();
});
</script>
And...
<div class="demo"><asp:textbox runat="server" id="DateTextBox" /></div>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不认为你的 jQuery 选择器中的 ID 是正确的。它应该只是
在您链接到的示例中,他们使用 id
datepicker
但您不必:)(datepicker 插件添加了hasDatepicker
CSS 类)。I don't think your ID is going to be correct in your jQuery selector. It should just be
In the example that you have linked to, they use the id
datepicker
but you don't have to :) (the datepicker plugin adds thehasDatepicker
CSS class).你应该这样做:
You should do this instead :