Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
29
rated 0 times [  35] [ 6]  / answers: 1 / hits: 73088  / 14 Years ago, sun, january 9, 2011, 12:00:00

Is it allowed to use <body onLoad=myfunc()> along with jQuery's document.ready() handlers?
I can't find a way to achieve the same functionality of the <body onLoad> with jQuery.



An example of a use case would be a facebook application. An Iframe facebook app requires the use of the FB.Canvas.setSize function which resize the iframe.



I would need to fire it up only when all elements on the page are finished loading.


More From » jquery

 Answers
6

$(window).load(myfunc) is what you're looking for. If you're working with the load event of an iframe, you can replace window with the iframe element/selector.


[#94315] Friday, January 7, 2011, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
korbindarrionh

Total Points: 598
Total Questions: 113
Total Answers: 104

Location: Burundi
Member since Wed, Nov 25, 2020
4 Years ago
;