2014-10-12 37 views
0

我試着添加datebox插件, 來自:http://dev.jtsage.com/jQuery Mobile的flipbox TypeErrpr:無法讀取屬性「原型」

我試着按照網站上的說明,但也許我失去了一些東西 因爲我不斷收到在頁面加載以下錯誤信息:使用MVC 4

"Uncaught TypeError: Cannot read property 'prototype' of undefined"

1m,並添加插件使用 '的NuGet'

我bundleConfig我的項目:

bundles.Add(new ScriptBundle("~/bundles/jqm-datebox-core").Include(
        "~/Scripts/jqm-datebox.core.js")); 

     bundles.Add(new ScriptBundle("~/bundles/jqm-flipbox").Include(
        "~/Scripts/jqm-datebox/jqm-datebox.mode.flipbox.js")); 

     bundles.Add(new ScriptBundle("~/bundles/jqm-datebox-en").Include(
        "~/Scripts/jquery.mobile.datebox.i18n.en.utf8.js")); 

      bundles.Add(new StyleBundle("~/Content/jqm-datebox") 
      .Include(("~/Content/jqm-datebox.css"))); 

layout.cshtml:

@Styles.Render("~/Content/pangojquerymobilecss", "~/Content/jqueryMobileIconsCss", "~/Content/jqueryMobileStructureCss", "~/Content/Mobile/css", "~/Content/jqm-datebox")   

@Scripts.Render("~/bundles/jquerymobile", "~/bundles/jqm-datebox-core", "~/bundles/jqm-flipbox", "~/bundles/jqm-datebox-en") 

的CSHTML:

<input type="text" data-role="datebox" data-options='{"mode":"flipbox"}'> 

,如果這是任何幫助,創建了頭,當我加載頁面:

<script async="" src="//www.google-analytics.com/analytics.js"></script><script src="/Scripts/jquery-2.1.1.js"></script> 
<script src="/Scripts/jquery.validate-1.13.0.js"></script> 
<script src="/Scripts/jquery.validate.unobtrusive.js"></script> 
<script src="/Scripts/jquery.unobtrusive-ajax.js"></script> 

<script src="/Scripts/jquery.mobile-1.4.2.js"></script> 
<script src="/Scripts/jqm-datebox/jqm-datebox.mode.flipbox.js"></script> 

<style type="text/css"></style></head> 

感謝

+1

我沒有在生成的頭文件中看到datebox核心和css ... – ezanker 2014-10-12 16:14:05

+0

我爲你創建了一個演示,爲你創建了一個演示。 - http://jsfiddle.net/kxfx9kfz/ – Tasos 2014-10-12 17:52:47

+0

@ezanker,謝謝。進一步檢查,我不明白爲什麼datebox-core,**和**語言js文件不會呈現,即時檢查在這個方向:http://stackoverflow.com/questions/16292493/asp-net-mvc-腳本包未呈現,但到目前爲止仍然無法正常工作,並且這些文件仍然無法呈現。有關我在layout.cshtml中添加文件的方式的任何評論?難道我做錯了什麼? – 2014-10-13 14:36:36

回答

0

對於它的價值,實際上就可以創建一個合併js文件,如果你喜歡這裏:

http://dev.jtsage.com/jQM-DateBox/builder/

它可以讓您定製到您正在使用的jQM版本包括您正在使用的模式,幷包括您需要的任何數量的語言文件。

如果由於某種原因,您需要使用未列出的版本(儘管1.4.4版本適用於整個jQM 1.4分支,1.4.0版本向後兼容1.3.0版本),但另一個選項只是將所有js文件的內容複製並粘貼到一個文件中 - 唯一的要求是.core文件必須首先出現,並且jQM必須在日期框之前加載。

+0

謝謝!使用了構建器的js文件,現在正在工作 – 2014-10-14 08:44:36