2014-09-04 60 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

相关问题