LetMeLearn123
LetMeLearn123

Reputation: 61

laravel routing css and js scripts

I have a laravel project and just wanted to use a simple timer jquery script in it. I created a new folder in views, placed there my code. I also placed there another folder called flip_timer with jquery files. My problem is that i cannot make the script paths work "not found http exception". Folder structure looks like this: folder in views > contains file(code below) and folder including all the needed files. Whenever i try to run the link with code the page is empty, and when i click to see the source code and click on the css or js link it shows me the error i mentioned above...

<link rel="stylesheet" type="text/css" href="flip_timer/jquery.flipcountdown.css" />
<script type="text/javascript" src="flip_timer/jquery.min.js"></script>
<script type="text/javascript" src="flip_timer/jquery.flipcountdown.js"></script>


<div id="retroclockbox1">
  <script>
    jQuery(function($){
    $('#retroclockbox1').flipcountdown();
})
  </script>
</div>

Upvotes: 1

Views: 1066

Answers (1)

Jigs Virani
Jigs Virani

Reputation: 4167

put your jquery.flipcountdown.css file in inside css folder named: css/flip_timer/jquery.flipcountdown.css AND your both js file inside js folder named:js/flip_timer/jquery.min.js and js/flip_timer/jquery.flipcountdown.js and then put below code in your html file.

<link rel="stylesheet" href="{{ URL::asset('css/flip_timer/jquery.flipcountdown.css') }}" />

AND for js file

<script type="text/javascript" src="{{ URL::asset('js/flip_timer/jquery.min.js') }}"></script>
<script type="text/javascript" src="{{ URL::asset('js/flip_timer/jquery.flipcountdown.js') }}"></script>

Upvotes: 1

Related Questions