ajax.reload() firing callback before DOM completely loaded
ajax.reload() firing callback before DOM completely loaded
timdw5s
Posts: 1Questions: 1Answers: 0
We are having an issue where the callback provided to ajax.reload() is being called before the DOM is completely reloaded. The reason I know this is because in the callback we attach click events and they stop working. If I wrap the reload in setTimeout() to delay the execution by 5 seconds then it works. Any ideas of why this is happening? I never have this issue with the initial page load using the "initComplete" function.
This discussion has been closed.
Answers
Can you link to an example page showing the issue so we can debug it please?
If you are using
$(document).ready( function () { ... } );
then the DOM will be ready.Allan