【问题标题】:Having issues with jquery ui datepicker and IE遇到 jquery ui datepicker 和 IE 的问题
【发布时间】:2010-04-07 05:31:48
【问题描述】:

这在 Firefox 中完美运行,但在 IE 中不起作用,即我收到以下错误“Line: 640 错误:对象不支持此属性或方法”

这是我的代码

  <asp:TextBox ID="calendardatedob" CssClass="calendardatedob" runat="server" AccessKey="n" TabIndex="4" MaxLength="40" /><span
                    class="req">*</span> e.g dd/mm/yyyy

这是我的 jquery

        $(document).ready(function() {

        $("#ctl00_PageContent_calendardatedob").datepicker();       
     });

我引用了这些

<script src="../../assets/js/jquery.min.js" type="text/javascript"></script>
<script src="../../assets/js/jquery-ui-1.8.custom.min.js" type="text/javascript"></script>

【问题讨论】:

  • ive 将选择器改为 .calendardatedob 但仍然出错
  • 是在您的网页中显示第 640 行,还是在 javascript 文件中显示?如果它在页面中,请查看源代码并确保这确实是错误,可能完全是其他错误。

标签: asp.net jquery jquery-ui


【解决方案1】:

我不确定这是否是您的错误,但您可以使用 Control.ClientID 来获取命名容器中的元素。

$("#<%= calendardatedob.ClientID %>").datepicker(); 

如果这也不起作用,则使用 DOM 检查器检查是否所有 js 文件都已加载。

【讨论】:

  • ive 将选择器改为 .calendardatedob 但仍然出错
  • 试试$(".calendardatedob").length看看是不是&gt; 0
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2017-01-04
  • 2011-12-16
  • 1970-01-01
  • 1970-01-01
  • 2013-04-18
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多