I’m pretty new to jQuery and, for my work, I use to take some JQuery free library and hack them for obtain what I need.
Now I’m in stuck because I have a JQuery that have to do something on page loading, so I use the “classical” JQuery document onload method
$(document).ready(function(){
....
}
and, of course, that method “load data” once at page first runtime.
Now I have some snippets of code that use Ajax calls for change the page and its content.
So JQuery snippet of code that is included into ready function have to be invoked and executed again but that doesn’t happen since ready function can’t be called.
I’ve tried to google about this, but my little experience, didn’t point me to the right place.
So, there is a “standard way” to call my JQuery function without move Ajax call into JQuery directly?
If I well understood you should refactor your code inside a function, e.g.
so when document.ready event occurs just call that function like so
and when you perform an ajax call (e.g. using
deferred objects)