【问题标题】:<input type="date" name="purchasedDate" id="purchasedDate"> not working in Internet Explorer [closed]<input type="date" name="purchasedDate" id="purchasedDate"> 在 Internet Explorer 中不起作用 [关闭]
【发布时间】:2016-04-14 04:52:51
【问题描述】:

我遇到了输入标签的问题。它在除 Internet Explorer 之外的所有主流浏览器中都能正常工作。

我的 IE 版本是 8。

<input type="date" name="purchasedDate" id="purchasedDate">

我也尝试了一些脚本,比如 polyfills,但问题仍然没有解决。

【问题讨论】:

标签: javascript jquery html cross-browser


【解决方案1】:

嗨,Meeti,

IE 不支持大多数这样的功能。所以要解决这个问题,你必须包含脚本来做到这一点。

示例脚本

Modernizr.load({
    test: Modernizr.inputtypes.date,
    nope: "js/jquery-ui.custom.js",
    callback: function() {
      $("input[type=date]").datepicker();
    }
});

我希望这对你有用。

【讨论】:

  • 谢谢 Rish... 现在它正在工作,,,
【解决方案2】:

元素&lt;input type="date" /&gt;在IE 8中是not supported。时期。

解决方案:

  1. 将date 替换为text。
  2. 使用jQuery / JavaScript 日期选择器。

注意:你不能让一辆卡车使用法拉利的引擎。

【讨论】:

    猜你喜欢
    • 2016-02-18
    • 2014-05-21
    • 2014-08-15
    • 2012-07-24
    • 2015-02-01
    • 1970-01-01
    • 2016-01-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多