DOM_scripter wrote :
> Hi, I want to set a picture on the fly. For this I have a html file
> with only an <img> tag - kind of a placholder.
> So I do myWindow=window.open("data/myFile.html"). Then I set the src
> attribute of the img object to the image I ant to show. I thought I
> could do this by myWindow.img.src but this does not work. Even
> myWindow.img.src.URL gives me an undefined so I wonder, is DOM access
> of an object I get via "window.open" possible at all?
Posting an url helps readers reading posts and helps them trying to
figure out what may be wrong in a page or set of pages.
For instance, we have no idea how you declare myWindow nor how you make
the call to change the src attribute.
You can modify the src attribute of a secondary window
1- assuming that the cross-domain security restrictions do not apply and
2- assuming that the document objects have been loaded in the document
when the access to the image is done. You must know that window object
and document object are created and loaded asynchronously.
For 1:
http://developer.mozilla.org/en/docs...and_parameters
For 2:
http://developer.mozilla.org/en/docs...en#Description
I have working examples of changing the src attribute of an image in a
secondary window.
Gérard
--
remove blah to email me