jquery - Unable to access parent popup div element using javascript -


i've been working on little script translated text supposed return in original position. seems fine, js still unable find window object. there wrong in code? have tried newxwin.document too, no use. please assist.

<?php    ?>    <html>    <head>  <script>  function domagic()  {  var newwin = window.open("https://translate.google.com/#auto/es/this%20is%20a%20test%20sentence.%0ai%20think%20i%20should%20try%20this.","newxwin","width=500,height=600");  }    function gettext()  {  alert(window.opener.document.getelementbyid("result_box").innerhtml + "");  }  </script>  </head>  <body>  <div id='todiv'></div>  <a href='#' onclick='javascript:domagic();'>get page</a>    <a href='#' onclick='javascript:gettext();'>get contents!</a>  </body>  </html>


Comments