how to add jquery in laravel project

前端 未结 5 686
忘了有多久
忘了有多久 2020-12-09 08:11

I am new to laravel framework. I want to use jQuery in web application built using laravel framework.

But don\'t know how to link to jQuery library

5条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-09 08:51

    You can link libraries from cdn (Content delivery network):

    
    
    
    
    

    Or link libraries locally, add css files in the css folder and jquery in js folder. You have to keep both folders in the laravel public folder then you can link like below:

    
    
    

    or else

    {{ HTML::style('css/style.css') }}
    {{ HTML::script('js/functions.js') }}
    

    If you link js files and css files locally (like in the last two examples) you need to add js and css files to the js and css folders which are in public\js or public\css not in resources\assets.

提交回复
热议问题