ajax.reload() firing callback before DOM completely loaded

ajax.reload() firing callback before DOM completely loaded

timdw5stimdw5s 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.

Answers

  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin

    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

This discussion has been closed.