tags:

views:

36

answers:

1

If you want an event to work on your page, you should call it inside the $(document).ready() function. Everything inside it will load as soon as the DOM is loaded and before the page contents are loaded.

I want to do javascript code only after the page contents are loaded how can I do that?

+7  A: 

Use load instead of ready:

$(document).load(function () {
 // code here
});
Matt
Thanks it works! You can also use body onload. (That's what I found out later)
Alex