I want some part of my JS to initialize when document is ready OR when ajax query completed
Something like this:
if ($(document).ready() or $(document).ajaxComplete()) {
// do something
}
Is it possible to write such a a condition?
And how do I make it right?
u can use bind Function
$(document).bind('ready ajaxComplete', function(){
// Your code here
})
Though I agree with Felix in comments that ready function is a separate function mostly used to carry actions only when entire document is loaded
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With