jQuery 日期选择器在内容页面中不起作用
我正在使用 jQuery 日期选择器。它在普通的 aspx 页面上运行良好。但它不适用于内容页面。
这是我的内容页面中的代码,
<asp:Content ID="body" ContentPlaceHolderID="ContentPlaceHolder1" runat="server" >
<div id="content">
<div id="examples">
<div>
Default time picker :
<input type="text" style="width: 70px;" id="timepicker.[1]" value="" />
<script type="text/javascript">
$(document).ready(function () {
$('#timepicker\\.\\[1\\]').timepicker();
});
</script>
</div>
</div>
</div>
</asp:Content>
我对 jQuery 不太熟悉,但我认为这些行会导致问题,因为它们检查 body 标签。我尝试在那里放置 div id 但无法让它工作。
find("body").append($.timepicker.tpDiv);
$("body").append(this.tpDiv);
如何在没有 body 标签的情况下附加 div
I am using a jQuery date picker. It works fine on a normal aspx page. But it doesn't work on the content pages.
This is the code in my content page
<asp:Content ID="body" ContentPlaceHolderID="ContentPlaceHolder1" runat="server" >
<div id="content">
<div id="examples">
<div>
Default time picker :
<input type="text" style="width: 70px;" id="timepicker.[1]" value="" />
<script type="text/javascript">
$(document).ready(function () {
$('#timepicker\\.\\[1\\]').timepicker();
});
</script>
</div>
</div>
</div>
</asp:Content>
I am not very familiar with jQuery but I suppose these lines cause problem since they check for the body tag. I tried using placing div id there but can't get it to work.
find("body").append($.timepicker.tpDiv);
$("body").append(this.tpDiv);
How can I append the div without body tag
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用类选择器。
use class selector.
也许你可以使用其他容器?喜欢
May be u can use some other container ?? like
1.运行您的页面。
2.右键-->检查元素 -->复制 ID。
3.现在将该 ID 粘贴到您的代码中并运行。
1.run your page.
2.right click --> inspectelement --> copy id.
3.now paste that id in your code and run.