简体   繁体   中英

How to call javascript file in laravel 5.5

I want to call JavaScript file, but I got error that function is not found

I want to call JavaScript file on this page.

This is my blade :

I put this:

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

在此处输入图片说明

This is my JavaScript file (lihatjadwal.js): 在此处输入图片说明

This is my route : 在此处输入图片说明

This is my controller : 在此处输入图片说明

I got error like this: 在此处输入图片说明 在此处输入图片说明

Thank you if somebody want to help me :)

You can't call laravel function to an external javascript file,

In you case you could use your url like,

url: '/daftarPeriksa/lihatjadwal',
type: "POST"

And try to use stackoverflow code editor instead of share image.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM