简体   繁体   English

IE11中的Datepicker问题

[英]Datepicker issue in IE11

We are using a jQuery datepicker which is working fine in Chrome and Firefox but we are having issues with IE11, specifically this error: 我们正在使用jQuery datepicker,它在Chrome和Firefox中运行良好,但我们遇到了IE11的问题,特别是这个错误:

Object doesn't support property or method 'datepicker' 对象不支持属性或方法'datepicker'

I expect my code to work fine with IE11 also. 我希望我的代码也适用于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);
    }
  });
});

Try to use F12 developer tools to check whether the JQuery UI reference load success. 尝试使用F12开发人员工具来检查JQuery UI引用是否加载成功。

Besides, please try to use the following JQuery reference: 此外,请尝试使用以下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