0

How do I add the js file to my page?

I have the following structure:

public
 - css
 - js
 - vendor
   - bootstrap
   - jquery

I want to use the jquery and bootstrap that are in my vendor folder.

I'm trying the following way.

<script type="text/javascript" src=" {{ asset('vendor/jquery/js/jquery-3.2.1.min.js) }} "> </script>
<script type="text/javascript" src=" {{ asset('vendor/bootstrap/js/bootstrap.min.js) }} " > </script>

but does not work, error appears

syntax error, unexpected 'vendor' (T_STRING)
1
  • You are missing the closing quote in asset('vendor/jquery/js/jquery-3.2.1.min.js). Right after .js Commented Jan 29, 2018 at 12:36

2 Answers 2

1

you have forgot to put ' at the end of assert function

<script type="text/javascript" src="{{asset('vendor/jquery/js/jquery-3.2.1.min.js')}}"> </script>
<script type="text/javascript" src="{{ asset('vendor/bootstrap/js/bootstrap.min.js')}}"> </script>
Sign up to request clarification or add additional context in comments.

Comments

0

You are missing the closing quote:

<script type="text/javascript" src=" {{ asset('vendor/jquery/js/jquery-3.2.1.min.js') }} "> </script>
<script type="text/javascript" src=" {{ asset('vendor/bootstrap/js/bootstrap.min.js') }} " > </script>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.