Forum Moderators: open
IE5(Mac/Win) uses the document.frames array document property.
IE5.5/6.0 uses (as you scripted) document.getElementByID() and contentWindow.document.
Try something like (this is off the cuff, not trialed):
// For IE5.5 and IE6.0
if (IFrameObj.contentWindow) {
IFrameDoc = IFrameObj.contentWindow.document;
}
// For IE5.0
else if (IFrameObj.document) {
IFrameDoc = IFrameObj.document;
}
else ...
else if (document.getElementById) {
alert("HERE");
var source = '<img width="'+width+'" height="'+height+'" src="'+imagelink+'" />';
var myframe = document.getElementById(framename).contentWindow.document;
myframe.open();
myframe.write(source);
myframe.close();
}
}
1. It doesn't seem to like if (contentWindow.document) so I must be doing something wrong here; and
2. I wasn't sure about var myframe = document.frames(framename); will the brackets work in this case?