If the response is ok, the event ajax:success get's fired. I use this event to search in the markup for missing Alpine JS Plugins. As the plugins must have been loaded before the markup appears on the page, it would be nice to have a preventDefault option with a function in details who can be called to continue the work.
Pseudo-Code
window.addEventListener('ajax:success', (event) => {
event.preventDefault();
const html = event.detail.response.html
// do the needed stuff
event.detail.render();
})
Like that It would be even possible the alter the markup:
window.addEventListener('ajax:success', (event) => {
event.preventDefault();
const html = event.detail.response.html
// do the needed stuff
event.detail.render(html);
})
If the response is ok, the event
ajax:success
get's fired. I use this event to search in the markup for missing Alpine JS Plugins. As the plugins must have been loaded before the markup appears on the page, it would be nice to have apreventDefault
option with a function in details who can be called to continue the work.Pseudo-Code
Like that It would be even possible the alter the markup: