Node Webkit - 尝试加载Twitter Bootstrap,“Uncaught Node.js Error”

时间:2014-10-04 12:17:13

标签: node.js twitter-bootstrap node-webkit

我是node.js的初学者,我想稍微试验一下。

我跟着the instructions on building a node webkit app。当我编辑index.html时,我添加了<script src="js/bootstrap.js"></script>并且它抛出了错误并显示了一个浮动的云:

Uncaught node.js Error 

TypeError: undefined is not a function
    at file:///C:/Users/Daniel/Desktop/node-webkit/js/bootstrap.js:158:7
    at file:///C:/Users/Daniel/Desktop/node-webkit/js/bootstrap.js:160:2

Bootstrap.js:

       | +function ($) {
       | ...
ln 158 | $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
       | ...
ln 160 | }(jQuery);

除了这些行之外,还有一堆错误行,但它似乎一次显示2个。

我不想调用任何node.js函数或方法,引导程序中是否存在与node webkit冲突的内容?

1 个答案:

答案 0 :(得分:1)

Twitter Bootstrap需要jQuery。好像你忘了把它包括在内。您应该下载它并在<script src="jquery-1.11.0.min.js"></script>包含bootstrap.js之前插入{{1}}。