Skip to content
Advertisement

Laravel – Javascript doesn’t work after I passed a parameter through route

I’m trying to create a website that showcases all search results from various e-marketplace. I’m using javascript to show the result, and it works fine before I try to pass parameter through route. But once I did, the result stopped showing. I assume it’s something to do with the Javascript. Here’s the code:

JavaScript

And here’s the code for the web.php:

JavaScript

And the SearchController code:

JavaScript

Can anyone tell me what’s wrong with this? Any help would be appreciated! Thanks 😀

Advertisement

Answer

I don’t know how nor do I know why, but the path to “text.html” doesn’t work when I passed a parameter through route. I’ve done some tests and found out that the path it needs is “yourweb.com/{path here}” instead of the directory. I solved it by adding a new route for text.html in web.php.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement