473,387 Members | 1,456 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

When is popped up window done rendering?

I have a situation where a bit of script needs to pop up another
window, and then call a script in that new window. My conundrum is
that the script should not be called until the new window has rendered
completely. What's the best way for the new window to tell its opener
that it is fully rendered? The thought that occurs to me is having a
script at the bottom of the new window that calls a script in the
openening window that then calls the "real" script in the new window.
The obvious solution (having the new window just call the script
itself) isn't feasible because the opener has the information that the
new window's script needs. Is there a better way to do this? I
apologize if I've explained my situation poorly.

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
Jul 23 '05 #1
3 1348
It doesn't truly matter where the script goes. If you want to be sure it
doesn't run until the window has fully loaded its code, put your script at
the end

- Wm
--
William Morris
Semster, Seamlyne reProductions
Visit our website, http://www.seamlyne.com, for the most comfortable
historically inspired clothing you can buy!

"Christopher Benson-Manica" <at***@nospam.cyberspace.org> wrote in message
news:c5**********@chessie.cirr.com...
I have a situation where a bit of script needs to pop up another
window, and then call a script in that new window. My conundrum is
that the script should not be called until the new window has rendered
completely. What's the best way for the new window to tell its opener
that it is fully rendered? The thought that occurs to me is having a
script at the bottom of the new window that calls a script in the
openening window that then calls the "real" script in the new window.
The obvious solution (having the new window just call the script
itself) isn't feasible because the opener has the information that the
new window's script needs. Is there a better way to do this? I
apologize if I've explained my situation poorly.

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.

Jul 23 '05 #2
Christopher Benson-Manica wrote:
I have a situation where a bit of script needs to pop up another
window, and then call a script in that new window. My conundrum is
that the script should not be called until the new window has rendered
completely. What's the best way for the new window to tell its opener
that it is fully rendered? The thought that occurs to me is having a
script at the bottom of the new window that calls a script in the
openening window that then calls the "real" script in the new window.
The obvious solution (having the new window just call the script
itself) isn't feasible because the opener has the information that the
new window's script needs. Is there a better way to do this? I
apologize if I've explained my situation poorly.


page1 opens page2
page1 wants to call a function in page2
page1 needs to know when page2 gets loaded.

page1:

window.open('page2.html')

page2:
function iAmLoaded(){
window.opener.functionNameInPage1YouWantToRun();
}
window.onload = iAmLoaded;

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/
Jul 23 '05 #3
In the new window that opens:

<script>
window.onload = function () {
var neededInfo = window.opener.getInfoForNewWindow();
// Use info gotten from parent window here.
}
</script>

Or let the parent window know when the new window is ready:

<script>
window.onload = function () {
window.opener.newWindowIsOpen();
}
</script>

Or you could actually check the status of the new window from the
parent window, but this is going to be more browser specific.

-Nate

Christopher Benson-Manica <at***@nospam.cyberspace.org> wrote in message news:<c5**********@chessie.cirr.com>...
I have a situation where a bit of script needs to pop up another
window, and then call a script in that new window. My conundrum is
that the script should not be called until the new window has rendered
completely. What's the best way for the new window to tell its opener
that it is fully rendered? The thought that occurs to me is having a
script at the bottom of the new window that calls a script in the
openening window that then calls the "real" script in the new window.
The obvious solution (having the new window just call the script
itself) isn't feasible because the opener has the information that the
new window's script needs. Is there a better way to do this? I
apologize if I've explained my situation poorly.

Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: TL | last post by:
Please help. I need to get this problem resolved ... When I ran remote shell to a Sun Solaris 8 box from W2K box, the DOS' CMD window popped up and stayed there until CGI timeout. The funny...
13
by: Kai Grossjohann | last post by:
It seems that Ctrl-N in Mozilla opens a new empty browser window. That's fine, I don't need to do anything about it. But Ctrl-N in IE appears to clone the current window. Is there a way to...
2
by: sonic | last post by:
Hi, I have some code attached to window.onload event and if there is a missing flash file on the page for example, the browser (MSIE in my case) displays "1 item(s) remaining" message, and since...
4
by: jessbody | last post by:
The following javascript code (used as a bookmarklet) is supposed to pop a window containig a "textarea". javascript:( function() { var nd =...
18
by: John Friedland | last post by:
My problem: I need to call (from C code) an arbitrary C library function, but I don't know until runtime what the function name is, how many parameters are required, and what the parameters are. I...
4
by: grayaii | last post by:
Hi, I have a simple form that handles all its paint functionality like so: this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.Opaque, true); And the entry point to this...
13
by: Bob Jones | last post by:
Here is my situation: I have an aspx file stored in a resource file. All of the C# code is written inline via <script runat="server"tags. Let's call this page B. I also have page A that contains...
2
by: kkganakga | last post by:
Hi, I used a short code to pop up a thumbnail in a new window for a gallery view. The problem is I would like to disable the right click function on the popped up / new window. How can I do this?...
6
by: Tweety | last post by:
Hello, I need to display the current Web Browser's Width on my web page. I Tried Screen.width, but it is for the width of the Windows. I tried Window.width, but it doesn't work. What i want...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.