get variable from iframe

1 message Options
Embed this post
Permalink
LewxX

get variable from iframe

Reply Threaded More More options
Print post
Permalink
short version:
does someone knows how to get access with JS to the content of a loaded iframe?

something like:

shadowbox.iframe.content.getElementById('mytag').innerHTML

long version:

Hello,

I've got a problem:

I want to use shadowbox on a board,
to upload pictures.

So I created a little upload php app,
that I load in an iframe.


What I want it to do:
After a file is uploaded,
and I click on the close button,
the name of the uploaded file is transported in the forum.

I'm very new at JS,
but is something like this possible:

in shadowbox.js
at the beginning of the close function:

close: function(){
outputfilename = iframe.getElementById('filename').innerhtml;
(I've created a div tag with filename inside)

then
document.getElementById('msg_box').innerhtml = outputfilename;

does someone knows the correct code for this?

Regards,
LewxX

(sry for my bad English, I'm a German ^^)