Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
103
rated 0 times [  106] [ 3]  / answers: 1 / hits: 33223  / 12 Years ago, sat, march 10, 2012, 12:00:00

Ok, I am going to rephrase my request as I think based on some of the answers, it got convoluted. All I am looking for is if there is a javascript command to fire the onload event from the javascript in the parent. A line of code such as:
document.getElementById('FrameID').fire.onload();
or if this cannot be done.



I am brainstorming an application where I am going to preload some iframes with url's, say 10 of them. I am then going to rotate them by hiding and displaying the frames. I want to be able to fire a window onload event after the active frame is displayed without reloading the page so the page will act as if it is fresh if it has an onload event. Can I do this? The pages may or may not have a window onload event.


More From » javascript

 Answers
3

This is the current method for re-emitting the load event:



dispatchEvent(new Event('load'));


https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Creating_and_triggering_events



Browser compatibility:




  • Chrome: 15+

  • Firefox: 11+

  • Microsoft Edge: all versions

  • Opera: 11.60+

  • Safari: 6+

  • Internet Explorer: none (see Dave's answer)


[#86942] Thursday, March 8, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
terrence

Total Points: 120
Total Questions: 115
Total Answers: 87

Location: England
Member since Fri, May 22, 2020
4 Years ago
terrence questions
Sat, Jun 5, 21, 00:00, 3 Years ago
Wed, Jun 17, 20, 00:00, 4 Years ago
;