erm_durr
erm_durr

Reputation: 537

Bootstrap/Laravel won't load javascripts

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". 

Upvotes: 0

Views: 2008

Answers (2)

Softinio
Softinio

Reputation: 658

Why don't you try using a CDN like:

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

ie just have this to replace all you have:

{{ 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') }}

Upvotes: 2

netvision73
netvision73

Reputation: 4921

It's like your first char in those JS is a <. I see that like a first char of a HTML tag. Are you sure of your JS path ?

Upvotes: 2

Related Questions