adsense

Thursday, April 25, 2019

document ready not fired after post back

jQuery DOM ready tends to break if you are still working with update panels and the actual reason for that can caused by many things.

For me, it was calling DOM ready in Sys.Application.add_load(function); as displayed below.

 <script type="text/javascript">
         
Sys.Application.add_load(DomLoad);

function DomLoad() {
        $(function() {
                   //more code
        });
 }

 </script>

This also can be useful if you want to add multiple page loads scripts.

Read the following stack overflow post for more discussion on the same topic.

Cheers,
Samitha

No comments:

Post a Comment