Solved

javascript pop up getElementById, innerHTML, etc

Posted on 2011-09-15
1
393 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 82

Accepted Solution

by:
leakim971 earned 500 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…

707 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now