In the following code, the alert works fine and prints "DIV : IFRAME" as it should however it then says that cNs[1].childNodes[1].document has no properties.
Html:
<div id="WinContainer"> <div style="display: none;"><iframe id="frame1" name="frame1"></iframe></div> <div style="display: none;"><iframe id="frame2" name="frame2"></iframe></div> </div> JavaScript:
var cNs = document.getElementById('WinContainer').childNodes; alert(cNs[1].tagName + ' : ' + cNs[1].childNodes[1].tagName); cNs[1].childNodes[1].document.location = 'someurl.pl'; BUT if I do this:
frame1.document.location = 'someurl.pl'; it works fine.
cNs[1].childNodes[1]is borked in all browsers, since you don't have whitespace anywhere between tags.