How to use $.ajax from JQuery in Blade ? #316
Unanswered
alexandreborba
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everybody !
I need some relatively simple help...
Background:
I have an old PHP application from a "pro-bono" client, without framework, where I am modifying the VIEW layer to use Plates and thus facilitate future maintenance. (Before I just did an include of the view file inside the Controller).
During the "conversion" I came across the following situation...
I have two SELECTs connected, as for example STATE -> CITY. When I select the State, the Cities of this State are inserted via $.ajax of the JQuery routine in the code.
Before plates, the url parameter of $.ajax pointed to a php file in the folder itself (directly)... example:
...
But now with plates, my view of this form is inside a folder themes/admin/...
I guess I can no longer point this url the same way (putting the file __ajaxGetCitiesByState.php inside this same folder themes/admin/).
What would be the correct way to access this file where I search the cities according to the State ID and return the OPTION list to insert in the SELECT of the cities?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions