0

I have the following

2 Iframes in 1 page MainWindow.php

<iframe frameborder="0" allowtransparency="true" name="iframeA" src="page1.php" width="38%" height="800" seamless></iframe>

<iframe frameborder="0" allowtransparency="true" name="iframeB" src="page2.php" width="58%" height="800" seamless></iframe>

page1.php is my content page

and below code is for page2.php

<!DOCTYPE html>
<html lang="en">
<head>
<script type="text/javascript">
document.getElementById('iframe1').src = document.getElementById('iframeA').src
</script></head>
<body>
</body>
</html>

When the page on iframeB change to the above javascript code on a page lets say reload.php, it doesn't reload iframeA, nothing happen, inspect element and no javascript error.

Baoky chen
  • 99
  • 2
  • 10
  • 1
    `name="iframeA"` should be `id="iframeA"` if you plan to use `getElementById` as a selector. – Antiga Oct 21 '14 at 15:36
  • Plese read [this answer](http://stackoverflow.com/a/24096958/1169519), there's a lot of information, how to refer across iframes. – Teemu Oct 21 '14 at 15:37
  • Have you seen http://stackoverflow.com/questions/21795761/insert-content-into-iframe? I think your question is misleading. Essentially, you're just trying to update an iframe in the DOM and that question answers how to do that. – Meezaan-ud-Din Oct 21 '14 at 15:38
  • 2
    if it's cross domain some frames won't allow communication to the opener frame. – Billy Oct 21 '14 at 15:50

0 Answers0