Currently, I am working on creating a slideshow and have implemented a navbar.js file with the following code:
images[0] = "{{ asset('cover/deanna-j-3GZlhROZIQg-unsplash.jpg')}}";
images[1] = "{{ asset('cover/kevin-laminto-iRZQjV--Z_4-unsplash.jpg')}}";
images[2] = "{{ asset('cover/pexels-andrew-neel-2123337.jpg')}}";
images[3] = "{{ asset('cover/pexels-leah-kelley-952588.jpg')}}";
images[4] = "{{ asset('cover/pexels-pixabay-460736.jpg')}}";
images[5] = "{{ asset('cover/pexels-tiff-ng-2711718.jpg')}}";
While the frontend of the website shows the slideshow functioning correctly, there is an issue where JavaScript does not interpret the 'asset' function resulting in incomplete image URLs such as: , hence the images not displaying.
I am looking for a solution to enable JavaScript to read the Laravel asset within the JavaScript file. Any suggestions?