簡體   English   中英

使jQuery移動日期框運行(TypeError:a.mobile.datebox未定義)

[英]get jQuery mobile datebox running (TypeError: a.mobile.datebox is undefined)

我無法運行jQueryMobile-DateBox。 它根本沒有顯示,我遇到了一些JS錯誤。 這是我的代碼:

標頭:

<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
<link rel="stylesheet" href="css/jquery.mobile.structure-1.2.0.min.css" />
<link rel="stylesheet" href="css/jqm-datebox-1.1.0.min.css" />
<script type="text/javascript" src="js/jquery.mobile-1.2.0.min.js"></script>
<script type="text/javascript" src="js/jqm-datebox-1.1.0.mode.calbox.min.js"></script>
<script type="text/javascript" src="js/jquery.mobile.datebox.i18n.de.utf8.js"></script>

身體:

<form id="formular" name="formular" method="post" action="enquiry.php">
  <table>
    <tr>
      <td>Arrival</td>
      <td><input name="arrival" id="frm_arrival" type="date" data-role="datebox" data-options='{"mode": "calbox"}' value="<?php echo $arrival; ?>" /></td>
    </tr>
    <!-- .... -->
  </table>
</form>

沒有顯示日期選擇器,Firebug給了我以下錯誤:

TypeError: a.mobile.datebox is undefined
TypeError: jQuery.mobile.datebox is undefined

錯誤應該在jquery.mobile.datebox.i18n.de.utf8.js第11行上。 這是一行:

jQuery.extend(jQuery.mobile.datebox.prototype.options.lang, {

我找不到錯誤。 這是jQuery沖突嗎? 我使用jQueryMobile - DateBox的方式錯誤嗎? 我做錯了什么?

切換這兩行,我想第一行取決於第二行:

<script type="text/javascript" src="js/jqm-datebox-1.1.0.mode.calbox.min.js"></script>
<script type="text/javascript" src="js/jquery.mobile.datebox.i18n.de.utf8.js"></script>

對此:

<script type="text/javascript" src="js/jquery.mobile.datebox.i18n.de.utf8.js"></script>
<script type="text/javascript" src="js/jqm-datebox-1.1.0.mode.calbox.min.js"></script>

編輯

您需要在標題中包含實際的日期框文件。 德文版僅是翻譯。 它不包含日期框插件本身。

像這樣排列腳本標簽:

<script type="text/javascript" src="jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="jquery.mobile-1.2.0.min.js"></script>
<script type="text/javascript" src="jquery.mobile.datebox-something-something.js"></script>
<script type="text/javascript" src="jqm-datebox-1.1.0.mode.calbox.min.js"></script>
<script type="text/javascript" src="jquery.mobile.datebox.i18n.de.utf8.js"></script>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM