Reputation: 216
So, I am trying to load a js file into a page, the file does not load when I use simple HTML <script>
tag, for example
<script src="js/laravel.js"></script>
But it loads when I use blade,
{!! Html::script('js/laravel.js') !!}
But the tricky part is, in some pages the simple HTML <script>
loads the js file fine but in some it does not work at all.
Upvotes: 0
Views: 2168
Reputation: 6438
To access your asset path, you can use asset
function helper:
<script src="{{ asset('js/laravel.js') }}"></script>
Upvotes: 3