0

I have a Laravel 5.0 project and inside of that I have a foo.blade.php file,in here I want to use some Javascript to get the pathname of the link the user currently in like so

window.location.pathname

Is it possible? Or blade templating allows only php to be written on the file?

Rehan
  • 3,813
  • 7
  • 37
  • 58

1 Answers1

0

First, Javascript runs client side, so whatever you write in <script> tag will be totally ignored by laravel.
But if you want to access path (route) in laravel, you can check this question.

Community
  • 1
  • 1
Jimish Fotariya
  • 1,004
  • 8
  • 21