2014-09-04 153 views
1

簡單的引導模式由一個按鈕觸發,一旦它被推送到heroku,當按鈕被點擊時模式不再顯示。我似乎無法弄清楚爲什麼,我嘗試了所有可以在網上找到的解決方案,但都沒有成功。我正在使用引導站點上的確切模式/按鈕組合,刪除了我的定製,直到我確定我可以將它運行到Heroku上。下面的HTML。這裏是鏈接到我的Heroku應用程序 - http://themommyboxco.herokuapp.com/模態不能在heroku上工作;但在本地正常工作

<!-- Button trigger modal --> 
<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal"> 
    Launch demo modal 
</button> 
<!-- Modal --> 
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria- labelledby="myModalLabel" aria-hidden="true"> 
    <div class="modal-dialog"> 
    <div class="modal-content"> 
    <div class="modal-header"> 
     <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button> 
     <h4 class="modal-title" id="myModalLabel">Modal title</h4> 
     </div> 
     <div class="modal-body"> 
     This modal is not showing up on heroku! 
     </div> 
     <div class="modal-footer"> 
     <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> 
     </div> 
    </div> 
    </div> 
</div> 
+0

您是否有鏈接直播? – DavidT 2014-09-04 15:39:04

+0

yup - http://themommyboxco.herokuapp.com/ – 2014-09-04 15:50:49

回答

0

你在你的application.js語法錯誤,線13371

$(function() 
    $("#menu").click(function() { 

應該是:

$(function() { 
    $("#menu").click(function() { 

確保關閉標籤稍後也有。

+0

你怎麼看到這些?我的application.js文件拉其他的JavaScript;該網站創建爲一個Rails應用程序,我沒有導入任何特定的JavaScript。我其實特別試圖導入模態js,但它並沒有改變這種情況。我在哪裏可以看到你指出的內容,以便我可以編輯它? PS。感謝你們對我的幫助。 – 2014-09-04 20:01:27

+0

這使得查找有點棘手。它在最終的application.js中,在這裏: http://themommyboxco.herokuapp.com/assets/application-692bbbe35437acf7826dfe2589d452e1.js 如果你打開Chrome開發者工具(Control-Shift-J),你會看到控制檯中出現錯誤。 – mz3 2014-09-04 20:39:50

相關問題