sandysh said:
Hello everyone, I am new to laravel and i have been working on a web app using this framework. Few days ago i got stuck in some code which i cant seem to understand at all. I am trying to pass a URL to an ajax request, the code goes like this if (pageurl.indexOf("externalnested.htm")!=-1){ the problem is it only accepts direct link as shown in the above example "externalnested.htm", but we all know that laravel does not accept direct routes, we need to pass it via routes, so i tried using if (pageurl.indexOf("{{ url('/mypage') }}")!=-1){, but it doesn't seem to work.
Any help will be greatly appreciated.
Thank you
Urls helpers should works in javascript with no problem. Can you refer more informations about the error you get?
Thank you @Othmanus for quick reply. I solved the problem. The problem was that javascript doesn't support {{url('')}} functions as such. Hence the only thing that i had to do my remove the url and adjust few things.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community