Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

javascript pop up getElementById, innerHTML, etc

Posted on 2011-09-15
1
Medium Priority
?
423 Views
Last Modified: 2012-05-12
     popup = window.open( "PTFACRPT/output/PTFinalEvalReportSOURCE.html", "", "status = 1, height = 400, width = 500, top = 200, left = 300, resizable = 1" )      
      alert(popup.getElementById("test").innerHTML)

This throws an err on the alert.
Can this work?
If so, how?
0
Comment
Question by:KeithMcElroy
1 Comment
 
LVL 83

Accepted Solution

by:
leakim971 earned 2000 total points
ID: 36546577
popup = window.open( "PTFACRPT/output/PTFinalEvalReportSOURCE.html", "", "status = 1, height = 400, width = 500, top = 200, left = 300, resizable = 1" )      
setTimeout( function() { alert(popup.getElementById("test").innerHTML) }, 5000); // wait 5 second to be sure DOM of the popup is ready


the better way is to call a parent function from the popup with something like : window.onload = function() {   opener.parentFunction();  }
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

782 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question