C
Csaba Gabor
Under IE 6, if I try to insert an IFRAME by DOM methods,
which IFRAME is targeted by a form, the form won't target
the inserted IFRAME element. Specifically, neither
myFrame.name nor myFrame.setAttribute("name",...)
seems to work. I can bypass the problem by putting in
a DIV and then setting the innerHTML of the DIV to
"<IFRAME name=... >target IFRAME</IFRAME>"
but this is really not very nice.
If there a more proper DOM oriented way to go about this?
Thanks,
Csaba Gabor from Vienna
The below works as expected in FF 1.5, but not in IE 6:
<html>
<head><title>Target test</title></head>
<body onLoad='loaded()'>
<form method=get target=myFrame action="http://google.com">
<button type=submit accessKey=u>S<u>u</u>bmit</button>
</form>
<script type='text/javascript'>
function loaded() {
var myFrame = document.createElement("IFRAME");
myFrame.style.width = '100%';
myFrame.style.height = '7cm';
myFrame.id = 'myFrame';
myFrame.name = 'myFrame';
document.body.appendChild(myFrame); }
</script>
</body>
</html>
which IFRAME is targeted by a form, the form won't target
the inserted IFRAME element. Specifically, neither
myFrame.name nor myFrame.setAttribute("name",...)
seems to work. I can bypass the problem by putting in
a DIV and then setting the innerHTML of the DIV to
"<IFRAME name=... >target IFRAME</IFRAME>"
but this is really not very nice.
If there a more proper DOM oriented way to go about this?
Thanks,
Csaba Gabor from Vienna
The below works as expected in FF 1.5, but not in IE 6:
<html>
<head><title>Target test</title></head>
<body onLoad='loaded()'>
<form method=get target=myFrame action="http://google.com">
<button type=submit accessKey=u>S<u>u</u>bmit</button>
</form>
<script type='text/javascript'>
function loaded() {
var myFrame = document.createElement("IFRAME");
myFrame.style.width = '100%';
myFrame.style.height = '7cm';
myFrame.id = 'myFrame';
myFrame.name = 'myFrame';
document.body.appendChild(myFrame); }
</script>
</body>
</html>