【问题标题】:IE11 compatibility mode: jQuery datepickerIE11兼容模式:jQuery datepicker
【发布时间】:2015-01-22 10:11:14
【问题描述】:

我必须更新旧代码才能使用 Microsoft Server 2012 和 IE11。该文档具有使用 jQuery datepicker 的过滤器功能。为避免进行许多更改,我们同意使用兼容模式,并且 IE 开发者工具会在整个页面显示“IE 7(默认)”。

当有人点击日历输入时,我们会看到日历表单,但点击日期不会触发任何操作。控制台为空。

我们发现将“about:blank”添加到站点列表(“兼容模式”)可以解决这个问题,但我想这样做,最终用户无需更改任何内容,只需添加服务器链接到这个列表。

你怎么看这个问题?你知道这种奇怪行为的原因是什么吗?

主页html:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

日期选择器:

$( 'input[type=text]#tbDateFrom, input[type=text]#tbDateTo' ).datepicker(
            {
                changeMonth:true,
                changeYear:true,
                showOn:'both',
                buttonImage:'/resources/images/infra/date.png',
                buttonImageOnly:false,
                buttonText:'Select a date',
                showOtherMonths:true,
                selectOtherMonths:true,
                constrainInput:true,
                dateFormat:'mm/dd/yy',
                onClose: function( dateText, inst ){ dateChanged(); },
                onOpen: function(){ $('html, body').animate({ scrollTop:'0px' }, 1500); }
            });

jQuery 1.6.2

jQuery UI 1.8.16

另一个提示,当我单击日历字段时,它触发了链接操作,并且链接已更改为“链接#,因为在 ano td onclick 中没有触发。 当我手动调用 DP_jQuery_1421938192356.datepicker._selectDay('#ajdi',0,2015, this) 并将其更改为对象处理程序时,它工作正常。 那么问题来了 IE 是如何创建动作结构的呢?

<TD onclick="DP_jQuery_1421938192356.datepicker._selectDay('#ajdi',0,2015, this);return false;" class=" " sizcache="1519" sizset="0">

<A class=ui-state-default href="http://localhost/dfworks/IMBPalletBrowserController?pl=locPalletMaintenanceFirst&amp;rdmstr=1421937671593#">9</A>

</TD>

【问题讨论】:

  • @ketan:够了吗?我应该添加更多吗?
  • 想象一下,如果你看到这个问题,你会怎么做?你跳过它。尽量简化和隔离问题,最好是单个语句。让信息更有条理,也许您可​​以告诉我们您的开发工具控制台中是否有任何错误?
  • 您实际上想用 IE 兼容模式做什么?如果您的应用程序无法使用它,这并不意味着这是您的错……如果您理解我的话。在您想要支持的 IE 的真实库存版本下对其进行测试,仅此而已。也许我没有得到你所要求的任何东西......

标签: jquery html datepicker internet-explorer-11


【解决方案1】:

解决方案是将日期选择器的版本从 1.8.16 更改为 1.11.2。 在新版本中,点击事件处理已更改为动态。

【讨论】:

    猜你喜欢
    • 2016-11-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-10-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-10-07
    相关资源
    最近更新 更多