Last post Apr 30, 2018 10:47 AM by PatriceSc
Apr 30, 2018 03:31 AM|madjester|LINK
My index.html page has an Object tag and it is used to display different pages when different buttons are clicked. I would like to call the Onload() function and execute some functions within it when a page loads inside of the Object tag.
Since the index page also calls the Onload() function, I am unsure where to place the functions that is used by the page inside the Object tag. I have a couple questions on what might happen if I put the the functions used by the index page and the page
1 - When a page inside the Object tag loads, will the Onload() function even execute?
files? Can a web site have more than one Onload() function?
Apr 30, 2018 10:47 AM|PatriceSc|LINK
onload applies to particular tags. So use body onload for what you want to be done when the page is loaded and according to http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element point
6, you have as well an onload event for the object tag.
It may give something such as :
<object data="https://www.bing.com/" onload="alert('object');" id="o">
<input type="button" onclick="document.getElementById('o').data='https://www.google.com/';">
It should show "object", "body" first. If you click the button it will show "object" again (though
www.google.com won't be shown as it sends a header to prevent being shown inside another document).