G
Grant Wagner
Simon said:There are no <iframe> tag in xhtml strict, instead I should use
<object>.
If I change <iframe> to <object> then my javascript stops working.
I am curious to how to use <object> with javascript ?
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Test</title>
<script type="text/javascript">
function reload() {
var el = document.getElementById("iframe");
el.contentWindow.location.reload();
}
var timer = null;
window.onload = function() {
timer = setInterval(reload, 4000);
}
</script>
</head>
<body>
<p>
Before
<iframe id="iframe" type="text/html" src="/content" width="330" height="57">
Blah
</iframe>
After
</p>
</body></html>
An <object> tag has no -src- attribute: <url:
http://www.w3.org/TR/REC-html40/struct/objects.html#h-13.3 />. Even if it did,
the <object> tag is not a window, so it doesn't have a -contentWindow-. The
<object> tag does have a -data- attribute, you can probably make use of that
fact.