Not Detecting Window.onload From Child Pop-up Window?

Nov 22, 2011

I am trying to pop up a window and then do stuff(set flags) when the content of the new window is done loading. For this I am trying to detect the window.onload of the pop-up child window but so far I am unsuccessful. I believe my problem is that the URL of child window is on different domain, than the one of the opener(parent) so that the window.onload is not being called. Thought this may change, at the moment I do not have access to the code for the page I'm opening up in the pop-up. Im pretty new to web development.

Heres my js code

Code:

//globals
var popupHandle = null;
var openingWindow = false;
function popWindow(URL){

[Code]....

Note: The whole reason why I am doing this is because if its the first time I am clicking on the button that will open this pop up window and I click it repeatedly very quickly, a new pop up is opened for each time I clicked eventhough the window.open is supposed to reuse the window if it has the same windowId. The first call to window.open takes long enough to not have a window handle and allow other clicks to get through.

View 2 Replies


ADVERTISEMENT

Child Pop Up Race Condition Using Window.open Need To Detect Window.onload

Nov 22, 2011

I am trying to pop up a window and then do stuff(set flags) when the content of the new window is done loading. For this I am trying to detect the window.onload of the pop-up child window but so far I am unsuccessful. I believe my problem is that the URL of child window is on different domain, than the one of the opener(parent) so that the window.onload is not being called. Though this may change, at the moment I do not have access to the code for the page I'm opening up in the pop-up. Im pretty new to web development.

[Code]....

View 3 Replies View Related

Child Window Close Event - Opening Another Link In A Separate Window Using Window.open()

Jan 29, 2010

I have a HTML and I am opening another link in a separate window using window.open() . The child window is something like 'http://yahoo.com' which is out side html. I need to refresh the parent window when the child window is closed.

View 4 Replies View Related

Automaticaly Clsoe The Parent Window When The Child Window Opened In Firefox?

Mar 24, 2011

i have this code i need to close the parent.html window when the child window opened, i need the code for that working well in IE and Firefox Parent.html

<HTML>
<SCRIPT TYPE="text/javascript">
function sendTo()
{
window.open('child.html','_blank','resizable=yes,width='+(screen.width-500)+',height='+(screen.height-500)+'');
}
[Code]...

View 2 Replies View Related

JQuery :: Create A Hidden Form Field In A Parent Window From Within A Child Window - Popup

Jun 13, 2011

Im trying to create a hidden form field in a parent window from within a child window (popup). I am trying to use jQuery, but unfortunately the hidden field does not get created.

Code JavaScript:

View 2 Replies View Related

Capture Child Window Close Event In Parent Window?

Feb 1, 2010

I have an HTML page where I am opening a child window using window.open. the child window is something like yahoo.com. I want to refresh the parent window when the child window is closed.

View 1 Replies View Related

Trigger Action In Parent Window When Child Window Closes?

Jun 25, 2009

Put a link on my page that will open an external site (over which I have no control) in a pop-up window. When the user closes the pop-up, I want my original page to redirect to another page. The difficulty I'm having is that I can't add any code to the page in the pop-up as it's not my site.

View 4 Replies View Related

Closing A Parent Window The Child Window Should Also Get Closed?

Apr 2, 2006

How can I trap, that on closing a parent window the child window should
also get closed.

View 1 Replies View Related

Call Parent Window Function From Child Window?

Jan 18, 2010

I have created and opened a child window called "checkwin" and have written some data to it. If the data is valid, I want the user to click on the 'CONFIRM' button on the child window, at which time I want the "submit()" function for the form on the parent window to be executed. If the data is invalid the user clicks on 'MODIFY' and I want focus to return to a field on the parent form. However, when I click on the "CONFIRM" or "MODIFY" buttons on the child window, nothing happens. Here is the code:

checkwin.document.write("</td></tr><tr><td align='right'><input type='button' value='CONFIRM'
onclick='opener.document.personnel_form.submit()'></td><td></td><td><input type='button' value='MODIFY'
onclick='opener.document.personnel_form.first_name.focus()'></td></tr></table>")

View 1 Replies View Related

Close Child Window When Parent Window Closes?

May 3, 2009

I'm trying to create code to close the child window I'm creating if the parent window is closed. Here's my code so far:

function openWindow() {
var newWin = window.open(); // open the new window
newWin.document.write('<h1>Child Window</h1>

[Code]...

The above openWindow function is used in this event: <input type="button" name="btn" onclick="openWindow()"value="Open a new window" />

I can generate the new window fine. I just can't close it if the parent window is closed.

View 1 Replies View Related

Pass Array From Child Window To Parent Window?

Jun 22, 2009

My scenario is like this.

1. Click on button and pop up child window.

2. Select multiple checkbox and submit array which send back to parent window and value store in a hidden variable.

i manage to do pop up child window, pass textfield value to parent window. But it cant send php array to parent window. Please help. I'm not good in js. code...

View 3 Replies View Related

Focus On Parent Window After Closing Child Window?

Sep 24, 2009

I'm having trouble with Safari. After i close a popup it does not focus on the parent window. I have been looking around and i think its this sort of thing i need 'javascript:window.opener.focus()" target="_self"' but tbh i'm not in anyway a javascript whizz, so im a little confused.

Here is my current code to close the child window

document.write("<input name='close' class='button popup' type='button' value='Close Window' onclick='window.close()' id='close'>"

So i need to somehow, add in the .opener thing to that.

View 2 Replies View Related

Refreshing The Parent Window After Closing The Child Window?

Jan 24, 2010

I have a parent page which I don't have control of. I call my child page from parent page, perform some operations and once I click update child window should close and parent window should be refreshed.Everything seems to work fine except the parent page not refreshing.I tried using window.opener.location.reload(true). But it makes a postback in the parent page and so the values that I update are lost because it makes a postback with the previous values.I tried window.opener.document.locationwindow.opener.document.location. But this doesn't refresh my parent page.

View 2 Replies View Related

Is-it Possible To Write In A Mother Window From A Child Window ?

Jul 23, 2005

Is-it possible to write in a mother window from a child window?

Like this:

Parent.document.write(............................ ................)

View 2 Replies View Related

Closing Child Window From Parent Window

Jul 20, 2005

Iam using mozilla firebird. I have three popups displayed at one point of time...if I close one the other two goes hidden....could you please suggest me the reason for this behaviour and how to overcome it.....

While I opened......these child windows(popup)...from the main window
I have given "dependent=yes" in the window.open statement.

The sameway I want to close the Child windows opened from the parent
window using IE. I use IE 6.0.

View 2 Replies View Related

Creating DIV In Parent Window From Child Window?

Jan 2, 2010

I have a probelm about creating DIV in parent window from child window. following code works find in IE8, but it does not work in IE7 and 6

aaa.html
Code:
<html>
<head>
<title>aaa</title>

[Code]....

View 2 Replies View Related

Close All Child Window With Parent Window?

Nov 26, 2010

I have parent page with 10 child window and i want to close all child window when click on close session button on parent but first i need to check whether any child window open or not after that action should be done for close the child window.

View 4 Replies View Related

Realod Div In Parent Window From Child Window?

Dec 20, 2005

At the moment, I have a page listing keywords associated with an image. The user can click an 'add keyword' link, which loads a child window where they have a form to select & add extra keywords. Now, at the moment when they submit the form, the page reloads the parent window using an onload event. However, I would prefer it if it only reloaded the DIV which holds their keyword list.

My thinking was I could do it with AJAX or something, but I can't find anywhere that even mentions if it's possible. Can anyone help? Is this possible, or am I too ambitious?

View 2 Replies View Related

Possible To Close All Child Window With Parent Window?

Nov 29, 2010

I want to close all child window with parent window. First i want to detect whether any child window open if open then it should be close after click close button on parent window.

View 8 Replies View Related

Open New Window From Child Window?

Oct 4, 2010

This is it- when i create the button code with HTML without script language on the page the button works well but when javascript code added is added to the page the button disappears. If i create the button with javascript it appears but does not open the next window.

View 1 Replies View Related

Way To Open New Window From Child Window

Oct 9, 2010

[Code]....

code to make this button work? In the parent window when 2 is input in the textbox and 'OK' button clicked, the second window opens with 2 textbox and 'SUBMIT' button. If 'SUBMIT' button is clicked in the child window i want it to open the new window.

View 1 Replies View Related

Which Loads Faster, Body Onload Or Window.onload

Dec 3, 2005

I wander what gets loaded the fastest (1-2 or 3) in what succession:

<head>
<script type="text/javascript">
function andAction() {
// doing stuff
}
</script>
</head>

<body onload="andAction();">
<script type="text/javascript">andAction()</script></body>

just in the head and nothing more

This I am sure off:

<head>
<script type="text/javascript">
window.onload = function andAction() {
// doing stuff
}
</script>
</head>
<script type="text/javascript">andAction()</script></body>

just in the head and nothing more (should be 1)

Third and last which is faster:

body onload or window.onload

View 3 Replies View Related

Window.onload And Body.onload Differences

Jul 23, 2005

I'm seeing a difference in behaviour between

window.onload = f();

and

<body onload="f();">

Specifically, window.onload appears to fire before all the elements of
the page have been rendered. As the difference is consistent across
IE/Moz/Opera, I'm assuming it's deliberate - can anyone point me
towards where this behaviour of window.onload is defined in the
documentation? TIA. Code:

View 2 Replies View Related

Detecting Onmouseup Outside Browser Window?

Jul 23, 2005

If I perform a mousedown within a document, move the mouse outside the
browser window, and then release the mouse button, the document.onmouseup
event does not fire. Is there any way to detect a mouseup event outside the
document?

Also, how can I get the relative coordinates of the cursor while it is
outside the browser?

View 20 Replies View Related

Detecting User Closing Window X

Jul 23, 2005

Can anybody let me know how to detect when my user clicks the X button
on the window. I used unload event it did not work(on IE). My web page
is a .asp page which reloads itself when navigating on the site. Now
whenever the user clicks any links on the page the unload event is
triggered which is not what I want. I only want to detect when user
clicks the X button and not when the URL changes.

code i used:
<body onunload="alert('leaving window');">

Basically this alert window is triggered everytime the URL changes and
not just when the window closes(which is what i want).

View 2 Replies View Related

Detecting And Acting On A Window Resize

Oct 25, 2006

I am able to detect a window resize using the following code:

window.onresize = function () {
if(document.getElementById("parent_for_video").style.display !=
"none") {
calculate_positions();

//Resize the main div
gray_div = document.getElementById("gray_div");
gray_div.style.height = h;
gray_div.style.width = w;

main_div = document.getElementById("main_div");
main_div.style.height= video_overlay_height;
main_div.style.width = video_overlay_width;
main_div.style.top = video_overlay_top;
main_div.style.right= video_overlay_right;

}//if(document.getElementById("parent_for_video").style.display !=
"none")
}//window.onresize = function ()

You should be able to see that when a resize is detected i move and
resize a couple of divs.

The thing is though i cant work out how to do this in real time. That
is the calculations only happen when i let go out the mouse. So if i
resize from massive to small the changes dont get reflected untill i
stop dragging the mouse.

I'd like to be able to resize and stuff as the mouse is dragging the
dimensions.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved