【问题标题】:How to implement jQuery datepicker offline如何离线实现jQuery datepicker
【发布时间】:2018-01-20 12:15:21
【问题描述】:

jQuery 的新手,我无法在离线设置中实现 jQuery。我已经关注了 Stack Exchange 中非常有用的帖子,但仍然无法让这个 jQuery datepicker 工作。

日期字段显示,但它没有拉出日历 UI。任何方向将不胜感激。这是html文件:

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>jQuery UI Datepicker - Default functionality</title>
  <link rel="stylesheet" href="jquery-ui.css">
  <link rel="stylesheet" href="/dev/css/style.css">
  <script src="jquery-1.9.1.min"></script>
  <script src="jquery-ui.js"></script>
  <script>
  $( function() {
    $( "#datepicker" ).datepicker();
  } );
  </script>
</head>
<body>

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


</body>
</html>

【问题讨论】:

  • 嗯......我的意思是......如果你想使用 jquery 和 jquery ui,你仍然必须包含 jquery 和 jquery ui。离线并不会改变这一点。为什么不直接使用 type="date"?
  • 您在控制台中遇到了什么错误?
  • ReferenceError: $ 未定义@ /dev/cal.aspx:18
  • $( function() {
  • 对,$ 未定义,应该如此。

标签: jquery datepicker


【解决方案1】:

问题是文件名不完全匹配,当我验证并修复它时,一切正常。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-11-21
    • 2015-06-08
    • 2014-01-30
    • 1970-01-01
    • 1970-01-01
    • 2013-08-22
    • 2015-07-29
    相关资源
    最近更新 更多