We have a main web page with Iframe on it. So we have a web page loaded into Iframe. There is a link on it (a
tag). We know its id. How to create a new Iframe on our main page that would follow that link? (link is relative to the site we put into our iframe).
Asked
Active
Viewed 67 times
0

Rella
- 65,003
- 109
- 363
- 636
-
http://stackoverflow.com/questions/700499/change-iframe-source-in-ie-using-javascript please check this thread. – linguini Sep 25 '11 at 21:39
2 Answers
1
Assuming the iframe and your web page is on the same domain, you get the a's href from the iframe's document.
var src = document.getElementById('myframe').contentWindow.document.getElementById('aid').getAttribute('href');
have a look here: http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_iframe_contentdocument

karnyj
- 1,182
- 1
- 9
- 10
0
You'd have to take the full url and past it into your own iframe.
If that's not what you meant please provide code.

checkenginelight
- 1,116
- 8
- 20