You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To run stuff code the Ajax load has completed, you could bind to the statechangecomplete event.
I'm also working on a fork of Ajaxify that has callbacks that are fired before and after the ajax load, plus many other changes and additions. https://github.com/prod4ever/ajaxify
I did something like this, which I hope helps others.
function ajaxInit() {
// All the code you want to retrigger
}
// Call myInit when document is ready.
ajaxInit();
// Call myInit again after each AJAX load.
$(window).on('statechangecomplete', function() {
ajaxInit();
// Optionally, do other stuff only after an AJAX load.
});
I'm curious... is there a callback we can use without having to input specific needs into the script?
I've tried hunting around, but I'm keen to add a few callbacks once the ajax method has completed; or better yet, an option beforeAjax and afterAjax.
Thanks,
R
The text was updated successfully, but these errors were encountered: