Closed imacrayon closed 11 months ago
This would be great to have included, but how could this be done in the meanwhile?
If you listen for the ajax:success
event it contains details about the server response in $event.detail
. You should be able to use that info to update the URL:
<form id="search_form" x-init x-target action="/search" @ajax:success="window.history.pushState({}, '', $event.detail.url)">
A form issuing a
GET
request will change the query string in the current URL. It would be good if AJAX-enabled forms would also update the URL so pages work the same way with or without JavaScript.