繁体   English   中英

IE11中的Datepicker问题

[英]Datepicker issue in IE11

我们正在使用jQuery datepicker,它在Chrome和Firefox中运行良好,但我们遇到了IE11的问题,特别是这个错误:

对象不支持属性或方法'datepicker'

我希望我的代码也适用于IE11。

$(document).ready(function() {
  $("#DOB").datepicker({
    dateFormat: "yy-mm-dd",
    changeMonth: true,
    changeYear: true,
    yearRange: "-100:-17",
    onSelect: function(selDate) {
      var selyear = $(".ui-datepicker-year").val();
      seldate = selDate.split('-');
      seldate = selyear + '-' + seldate[1] + '-' + seldate[2];
      $(this).val(seldate);
    }
  });
});

尝试使用F12开发人员工具来检查JQuery UI引用是否加载成功。

此外,请尝试使用以下JQuery参考:

<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<link rel="stylesheet" href="/resources/demos/style.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM