jQuery datepicker在IE8中遇到麻烦?

我确实看到了几个类似的线程,但后来他们发现是不同的问题…我的似乎是浏览器特定的问题,因为我的日期选择器在Firefox中工作正常,但肯定不在IE8中.
Here is my original problem and the source code

我将我的datepicker更新为jQuery UI Datepicker 1.8.11 …但它仍然无法在IE 8中运行!弹出日期选择器就好了,但没有事件发生.我是说没有点击……没有任何反应……

有任何想法吗?

解决方法

嘿我不知道你是否已经解决了这个问题,但问题是任何附加的属性.特别是如果你使用:
yearRange: '-100:+10'

例如 …

这是您解决问题的方法:从http://satish.name/?p=19复制

jQuery datepicker在IE中为DOM元素添加一个属性.如果您尝试从现有元素动态复制添加新DOM元素,则datepicker将无法在IE中工作,因为新添加的DOM元素引用旧的jQuery属性.解决此问题的一种方法删除属性,然后在元素上实例化datepicker类.请参阅以下代码获取此修复程序.

//newDiv is the new added dom element with innerHTML
jQuery("#newDiv").find(".datePicker").each(function() {
    //removing jquery added attribute as this is causing the dynamically
    // added DOM elem referring old DOM element from it is copied.
    if (jQuery.browser.msie) {
        var jqaddedattr;
        jQuery(this.attributes).each(function() {
            if (this.name.search(/jQuery/) != -1) {
                jqaddedattr = this;
            }
        });
        if (jqaddedattr) {
            jQuery(this).removeAttr(jqaddedattr.name);
        }
    }
    jQuery(this).datepicker({yearRange: '-100:+10',changeFirstDay:false}).val("").trigger('change');
})

干杯

相关文章

页面搜索关键词突出 // 页面搜索关键词突出 $(function () {...
jQuery实时显示日期、时间 html: <span id=&quot...
jQuery 添加水印 <script src="../../../.....
中文:Sys.WebForms.PageRequestManagerParserErrorExceptio...
1. 用Response.Write方法 代码如下: Response.Write(&q...
Jquery实现按钮点击遮罩加载,处理完后恢复 思路: 1.点击按...