nick wrote:
I have the following code:
var w=window.open('popup.htm','','width=400,height=400 ');
w.opener = this;
Useless and wrong. Avoid coding like that.
var img = w.document.getElementById('pic');
Right here, you're assuming a synchronous chain of event: the window
might be created but the document might still be loading. So you're
referencing the document which has not been loaded yet.
However, the img variable is always null in Mozilla Firefox.
Because the document still has not fired the load event and created
pointers in the memory heap.
But it works well in IE.
What's teh proper way to access DOM in the popuped window?
Get an onload event in the body of the popup window to call a function
in the opener to access the picture. It works reliably in NS 7.x,
Mozilla 1.x, Firefox 0.8+, K-meleon 0.8+, Opera 7.x, MSIE 6 SP2.
DU
--
The site said to use Internet Explorer 5 or better... so I switched to
Mozilla 1.7.3 :)