Javascript 未捕获类型错误:引导模式未定义

Javascript 未捕获类型错误:引导模式未定义,javascript,jquery,twitter-bootstrap,modal-dialog,bootstrap-modal,Javascript,Jquery,Twitter Bootstrap,Modal Dialog,Bootstrap Modal,查看代码: <div class="modal fade" id="warning_modal"> ... </div> 此外,我尝试通过CDN添加bootstrap.js,但也没有成功 <head> <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js" rel="stylesheet"> </head> 您的模式需要id=“w

查看代码:

<div class="modal fade" id="warning_modal">
  ...
</div>
此外,我尝试通过CDN添加bootstrap.js,但也没有成功

<head>
  <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js" rel="stylesheet">
</head>

您的模式需要id=“warning\u model”,而不是submit\u model

html:


您使用的是
==true
,而不是
==true
。为什么?确保你的引导程序确实加载到你的文档中。@ZeeTee除了在
application.js
文件中需要它之外,我如何确保它被加载?我通常有一个bootstrap.js文件,不知道你在使用什么。是的,这就是我正在做的哦,这是我一个愚蠢的复制/粘贴错误。。。它有警告模式,我已经更新了问题,我们需要更多信息。那么JSFIDLE呢?在另一篇文章中阅读这篇文章,它没有任何意义,但是尝试将
/=require jquery
移动到下面
/=require bootstrap.min
//= require jquery
//= require jquery_ujs
//= require_tree .
//= require bootstrap.js
<head>
  <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js" rel="stylesheet">
</head>
<div class="modal fade" id="warning_modal">
...
</div>
if (<%= flash[:warning] %> === true ) {
console.log("it's now in the function")
$('#warning_modal').modal({
show: true,
keyboard: true
});
}
//= require jquery
//= require jquery_ujs
//= require bootstrap.min
//= require_tree .