Should be easy, but I’m not getting results. I’m trying to get the filename of the scr= documentname of an IFRAME. The IFRAME is the child of the top-level document, (happens to be a .php file if that matters, but the .php code is nowhere near this). The JS is called from the top-level document.
The IFRAME is defined with
[CODE]<iframe src=”../../photos/index.htm” name=”galleryFrame” …*
The IFRAME displays the HTML source file just fine.
I’ve tried:
document.write(“Hello World”)
document.write(document.galleryFrame.document.url)
document.write(document.frames[‘galleryFrame’].document.url)
document.write(document.frames[‘galleryFrame’].document.url)
document.write(parent.frames[‘galleryFrame’].document.url) (didn’t expect this to work, since this is the top-level document)
Where I’m eventually hoping to get to with this is:
document.write(document.frames[‘galleryFrame’].document.images(‘thumb1’).src.url
“Hello World” is displaying on the page just fine.
* I’ve tried ID=”galleryFrame” also, and tried to retrieve it with getElementByID(‘galleryFrame’), but that doesn’t seem to work either.
Thanks,