Html程序  |  22行  |  461 B

<html>

<head><title>Post message subframe tests</title>
<script>
  function postToOpenerFrame(msg, origin) {
    window.opener.frames[0][1].postMessage(msg, origin);
    return true;
  }

  window.addEventListener("message", messageReceived, false);

  function messageReceived(event) {
    // Change the title to generate a notification.
    document.title = event.data;
  }
</script>
</head>

<iframe id="frame1" src="frame_tree/1-1.html"></iframe>

</html>