Moist wrote:
I have an embedded HTML object as follows (ignore the code tag):
<code>
<object id="page" data="table.html" type="text/html" .... >
</code>
I look for the Javascript code (placed in the main document) that can reload
or refresh the object contains at will?
Consider using an iframe e.g.
<iframe name="iframeName" src="table.html"></iframe>
that way you can in all browsers script
window.frames.iframeName.location.reload();
Refreshing an <object> is difficult across browsers, recent Opera and
Netscape/Mozilla version allow you to access the contentDocument
property of the HTMLObjectElement element object and then you can access
the defaultView and from there the location object:
<object id="object1"
type="text/html"
data="test2004090402.html">
width="200" height="200"></object>
<input type="button" value="refresh"
onclick="var object = document.getElementById('object1');
if (object.contentDocument &&
object.contentDocument.defaultView &&
object.contentDocument.defaultView.location) {
object.contentDocument.defaultView.location.reload ();
}">
--
Martin Honnen
http://JavaScript.FAQTs.com/