iT邦幫忙

0

[PHP][Laravel][Blade]利用asset()設定JS及CSS來源檔案卻無法使用?先看看...

https://ithelp.ithome.com.tw/upload/images/20201108/20131801zbip9U74fW.png
我的檔案來源是table_search.js,原本預設是放在resource資料夾中。

https://ithelp.ithome.com.tw/upload/images/20201108/20131801ySYnZa1dcr.png
我將table_search.js的路徑放在asset()中卻沒辦法使用。

https://ithelp.ithome.com.tw/upload/images/20201108/20131801b30Oa8JTl6.png
後來我在stackoverflow找到解決方法,只要將資料放在public資料中就行了。

https://ithelp.ithome.com.tw/upload/images/20201108/20131801qFkWy5cN1l.png
實際嘗試後,結果真的可以用。

參考資料:
https://stackoverflow.com/questions/36192167/external-javascript-not-running-in-laravel-5


圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言