【问题标题】:Datepicker in JQuery Mobile is not workingJQuery Mobile 中的日期选择器不工作
【发布时间】:2013-12-02 07:08:54
【问题描述】:

我是 Jquery mobile 的新手,我在视图中添加了一个日期选择器

我添加了插件,我的代码是

 <head>
 <link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css">
 <link href="http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.css"rel="stylesheet">
<link href="../../docs/_assets/css/jqm-docs.css" rel="stylesheet">
<link rel="stylesheet" href="jquery.ui.datepicker.mobile.css" /> 
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>  
<script>

 $( document ).bind( "mobileinit", function(){
  $.mobile.page.prototype.options.degradeInputs.date = true;
 });    
 </script>
 <script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>
<script src="jQuery.ui.datepicker.js"></script>
<script src="jquery.ui.datepicker.mobile.js"></script>

 </head> 

这有什么错误吗?

我按照这个教程, http://jquerymobile.com/demos/1.0a4.1/experiments/ui-datepicker/

【问题讨论】:

  • 浏览器控制台中的任何错误
  • 最后尝试添加您的mobileinit 代码。
  • @Arun.. 控制台没有错误..我厌倦了萤火虫
  • @rps..如果我想放置 tat.. 请参考上面的教程.. 按照 tat 我放置的东西

标签: javascript jquery datepicker


【解决方案1】:

将您的代码与view source: of mobile datepicker link 进行比较。

您刚刚从他们的源代码中复制了代码

他们的文件夹中有以下这些文件,您无法访问这些文件

<script src="jQuery.ui.datepicker.js"></script>
<script src="jquery.ui.datepicker.mobile.js"></script>

将这些文件下载到您的本地计算机并访问它。

<script type="text/javascript" src="/path to these files" />

【讨论】:

【解决方案2】:

我正在为 asp.net 网站编写此代码

<script>
    $(function () {

        $("#From_date").datepicker({ dateformat: "yy-mm-dd" }).val()
    }
);

【讨论】:

  • 其实这不是OP的问题。
猜你喜欢
  • 2011-11-11
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多