Wednesday, June 5, 2024
 Popular · Latest · Hot · Upcoming
127
rated 0 times [  129] [ 2]  / answers: 1 / hits: 51401  / 15 Years ago, wed, august 12, 2009, 12:00:00

I have an iFrame, content of which is inside another iFrame. I want to get the inside iFrame's src content. How can I do this using javascript?


More From » iframe

 Answers
42

The outer page:



<html>
<body>
<iframe id=ifr1 src=page1.htm></iframe>
<iframe id=ifr2 src=http://www.google.com></iframe>
</body>
</html>


page1.htm:



<html>
<body>
<script type=text/javascript>
document.write(parent.document.getElementById('ifr2').src);
</script>
</body>
</html>

[#98932] Friday, August 7, 2009, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tinakimv

Total Points: 126
Total Questions: 90
Total Answers: 104

Location: Netherlands
Member since Mon, Jun 7, 2021
3 Years ago
;