Get Laravel 'public' path for javascript file -


i'm unsure how can equivalent to: path('public') work in javascript file?

i need path public folder displaying images js file.

you opt create variable in javascripts global namespace in head of document , use php echo out public path.

<head>     <script>         var public_path = '{{ path('public') }}';     </script>  ... 

Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -