【问题标题】:JQuery datepicker not working for last versionJQuery datepicker 不适用于最新版本
【发布时间】:2015-05-27 09:20:39
【问题描述】:

我第一次尝试使用 jquery,但我无法让它工作。

我的代码如下:

<html lang="en">
<head>
  <meta charset="utf-8">
  <title>jQuery UI Datepicker - Display inline</title>
  <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
  <script src="//code.jquery.com/jquery-1.10.2.js"></script>
  <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
  <script src="@Url.Content("~/Scripts/datepicker/jquery.ui.datepicker.js")" type="text/javascript"></script>
  <link rel="stylesheet" href="/resources/demos/style.css">
  <script>
  $(function() {
    $( "#datepicker" ).datepicker();
  });
  </script>
</head>
<body>

Date: <div id="datepicker"></div>


</body>
</html>

【问题讨论】:

标签: jquery datepicker


【解决方案1】:

试试这个..

将 div 替换为日期:&lt;input type="text" id="datepicker" /&gt;

<html lang="en">
    <head>
      <meta charset="utf-8">
      <title>jQuery UI Datepicker - Display inline</title>
      <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
      <script src="//code.jquery.com/jquery-1.10.2.js"></script>
      <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
      <script src="@Url.Content("~/Scripts/datepicker/jquery.ui.datepicker.js")" type="text/javascript"></script>
      <link rel="stylesheet" href="/resources/demos/style.css">
      <script>
      $(function() {
        $( "#datepicker" ).datepicker();
      });
      </script>
    </head>
    <body>

    Date: 
    <input type="text" id="datepicker" />

    </body>
    </html>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-01-17
    • 2019-06-29
    • 1970-01-01
    相关资源
    最近更新 更多