Passing info from one page to another - tricky problem

E

Edwin

I've been Googling & can't find a consistent cross-browser (IE & Firefox) answer to
this...

I need to pass some data from inside an iframe, to the parent page

I've got the parent page PAGE1.HTM which contains
<div ID="mydata"></div>
:
<iframe src="page2.htm"></iframe>


And, inside PAGE2.HTM I will set mydata to a hard string. But in page2.htm do I do

var parent.document.mydata.innerHTML = "my data here'

or

var window.parent.document.all.mydata.innerHTML = "my data here"

or something else...??? to be cross-browser compatible (IE and Firefox mainly).


Thanks!
 
R

Randy Webb

Edwin said the following on 8/7/2006 2:14 PM:
I've been Googling & can't find a consistent cross-browser (IE & Firefox) answer to
this...

Then you didn't Google very hard in the archives of c.l.j
I need to pass some data from inside an iframe, to the parent page

I've got the parent page PAGE1.HTM which contains
<div ID="mydata"></div>
:
<iframe src="page2.htm"></iframe>


And, inside PAGE2.HTM I will set mydata to a hard string. But in page2.htm do I do

var parent.document.mydata.innerHTML = "my data here'

or

var window.parent.document.all.mydata.innerHTML = "my data here"

or something else...??? to be cross-browser compatible (IE and Firefox mainly).

window.parent.document.getElementById('mydata').innerHTML
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,243
Latest member
Weeb3PRAgency

Latest Threads

Top