Saturday, May 11, 2024
 Popular · Latest · Hot · Upcoming
94
rated 0 times [  95] [ 1]  / answers: 1 / hits: 25224  / 11 Years ago, mon, may 20, 2013, 12:00:00

How can you make two iFrames talk to each other?
For example I was a element value off the 2nd iframe and the 1st iframe has the display element on it. I need to get the value off the 2nd frame to the 1st. How would I do this?
Don't say use cookies, cause that will hurt with massive sum of data.


More From » html

 Answers
13

If the <iframe> elements are served from the same domain, then they can access each other directly. For example, in iframe1 you could do:



document.getElementById('someDiv').innerHTML = 
top.document.getElementById('otherIframe').contentWindow.
document.getElementById('someOtherDiv').innerHTML;

[#78119] Saturday, May 18, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
valentinam

Total Points: 166
Total Questions: 117
Total Answers: 81

Location: Puerto Rico
Member since Sun, Jun 27, 2021
3 Years ago
;