0

I try to load my javascripts like this:

                        <!-- Le javascript -->
<!-- ================================================== -->
<!-- Placed at the end of the document so the pages load faster -->

 {{ HTML::script('http://code.jquery.com/jquery-2.0.3.min.js') }}
 {{ HTML::script('js/bootstrap-transition.js') }}
 {{ HTML::script('js/bootstrap-alert.js') }}
 {{ HTML::script('js/bootstrap-modal.js') }}
 {{ HTML::script('js/bootstrap-dropdown.js') }}
 {{ HTML::script('js/bootstrap-scrollspy.js') }}
 {{ HTML::script('js/bootstrap-tab.js') }}
 {{ HTML::script('js/bootstrap-tooltip.js') }}
 {{ HTML::script('js/bootstrap-popover.js') }}
 {{ HTML::script('js/bootstrap-button.js') }}
 {{ HTML::script('js/bootstrap-collapse.js') }}
 {{ HTML::script('js/bootstrap-carousel.js') }}
 {{ HTML::script('js/bootstrap-typeahead.js') }}

But still, it doesn't load. I've checked the console in Chrome Developer Tools, and it returns for the most of them the following error:

Uncaught SyntaxError: Unexpected token < :8000/js/bootstrap-transition.js:4
Uncaught SyntaxError: Unexpected token < :8000/js/bootstrap-alert.js:4
Uncaught SyntaxError: Unexpected token < :8000/js/bootstrap-modal.js:4
Uncaught SyntaxError: Unexpected token < :8000/js/bootstrap-dropdown.js:4
Uncaught SyntaxError: Unexpected token < :8000/js/bootstrap-scrollspy.js:4
Uncaught SyntaxError: Unexpected token < bootstrap-tab.js:4
Uncaught SyntaxError: Unexpected token < :8000/js/bootstrap-tooltip.js:4
Uncaught SyntaxError: Unexpected token < bootstrap-popover.js:4
Uncaught SyntaxError: Unexpected token < :8000/js/bootstrap-button.js:4
Uncaught SyntaxError: Unexpected token < :8000/js/bootstrap-collapse.js:4
Uncaught SyntaxError: Unexpected token < :8000/js/bootstrap-carousel.js:4
Uncaught SyntaxError: Unexpected token < :8000/js/bootstrap-typeahead.js:4
Resource interpreted as Script but transferred with MIME type text/plain: "chrome-extension://gppongmhjkpfnbhagpmjfkannfbllamg/js/inject.js". 
4

2 回答 2

2

为什么不尝试使用 CDN,例如:

<script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>

即只需要这个来代替你所拥有的:

{{ HTML::script('http://codeorigin.jquery.com/jquery-2.0.3.min.js') }}
{{ HTML::script('//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js') }}
于 2013-08-12T16:11:00.100 回答
2

就像你在那些 JS 中的第一个字符是 <。我认为这就像 HTML 标记的第一个字符。你确定你的 JS 路径吗?

于 2013-08-12T08:36:09.210 回答