A Way To Monitor Child Window Across Opener Reloads ?
Jul 23, 2005
Is there a way to monitor a newly opepend child window with opener,
even when the page keeps reloading ?
Say window A opens window B and gives it a name/handle "myWindow".
At this point anywhere in window A, we could say
myWindow.location.href to find out where the child is.
But what if someone was to take window A to another site, and than
return using history button, OR reload it completely.
upon load the var myWindow would get executed again, and it seems like
the handle would be lost. I tried to see if there was a
window.children collection that might still hold window B in its
subset, but was not able to find a way thus far.
This pops up a new window with every call. In the child window I call a parent function onbeforeunload, appClose() :
function appClose(){
if (window.opener && !window.opener.closed){ window.opener.CloseChild(getQueryString("application")); }}
This is in my frameset tag of the child code :
<frameset ... onbeforeUnload='appClose()'>
The window.opener.CloseChild() function is called perfectly when I have one child window open, but as soon as I create another child window both of the open child windows don't ever call it. They do both go into the onbeforeunload appClose() function, but do not call the window.opener.CloseChild() function inside of this routine.
Anyone have any ideas why when I have two child windows open I can't access the window.opener functions?
I have tried taking each new window out of the array and used the following code in CloseChild() :
I see how the window.opener works, pretty neat in that the pop window knows the parent.
Is there a property that also knows the form field parent?
My function does not know which of the 3 select menus called it.
What can I do?
function onCarrierSelect() { // var frm = document.carrRequestForm.carrierList.selectedIndex var selectCar = document.carrRequestForm.carrierList.options[frm].text; alert(selectCar); if (window.opener && !window.opener.close) window.opener.document.form(x how make global?).nbcarrier(x how make global?).value = selectCar window.close(); }
p.s. as an aside I know the form field name, it is literally in the querystring, but that is ASP/vbscript and no way to get it into the jscript function...
How do I get the contents of an element in the opener and show them in the child?
What I'm trying to do is something like this:
In the opener: <h1 id="pgtitle">Office XP</h1>
In the child: function gt_pageCont () { var pagetitle = window.opener.document.getElementById("pgtitle"); var pagetext = "<h1>""+title+""</h1><p>Here are some more info about "" +title+ "".</p>"; document.write(pagetext); }
and: <body onload="gt_pageCont();">
I know that something is missing in the function, because I've tested it and the child displays [Object] instead of "Office XP".
The original window should not reload, but is, and I have tested it with both version 4.72 and 7.02, and they both do it. IE does not do it. The big problem is that the original window has security built into it so it must be called from the right referring url, but when Netscape reloads this parent window, it neglects to send the original referring url, so the original page is replaced with an error page as soon as the above link is clicked.
Is there any workaround for this, where either Netscape will not reload the original page, or if it does, at least not lose the referring url?
I am currently encountering a problem with setting "display" property from "none" to "block":
Browsers will refresh itself when the display property is changed; this causes the element to display then suddenly disappear after the page reload. Do you guys have an idea what I can do to avoid it?
I tried using jquery's show command, css command with setting display to block, and pure javascript method like document.getElementById("theId").style.display="block".
I am trying to usw window.open , upload a file in the child window and then referesh the parent window. But once upload is done, window . opener .location.href or opener.location.replace sends a message back but I get a pop up blocker, so if I turn pop up blocker off, it opens in new page. I just want the parent page to refresh on the same window. This works on some employees stations but not on others..I don't know if there are any settings on IE that need to change, I tried everything...weird. does any one done this before?
I'm using window.showModalDialog but having an issue trying to set the parent window(main browser). I open modal window A which is then opens modal window B, top of modal window B onload I do window.opener.close()". My issue now is when i'm finished with B I set parent window(main browser) to a new url with window.opener.location. So my problem is modal window A the parent has been closed so window.opener.location will not work.
Firstly I know this issue has been addresses a lot already but as a newbie to HTML and Web Development I am unable to get the idea. according to documentations and solutions proposed on different forums a popup or child window can be only closed using window.close() if it is opened via window.open() function.
I have a form that is in a popup window. I need the form to submit to the opener window. Is is possible to do that? The opener window is the main window so it is does not have a name and there are no framesets.
<form action="something.php" method="post" target="????"> I'd like to use window.opener in the target but that's JavaScript...
I know somebody has done this before and has the code.
I see this problem in IE but not Firefox. I have a page that opens a second page as a dialog box. If the Dialog is relaunched from a second instance on the page the Dialog window is reused, the controls are reinitialized but window.opener still refers to the original opener. I have simplified code than demonstrated the problem. Code:
If i open a link either by using the right mouse menu "open in new window" or press shift (IE) on the link the page will be opened in a new window. From this window I can use the window.opener object to access the opening window.
When doing this in NN7.1 I cannot access windows.opener. If I open the window with window.open I can also use the window.opener to access the opening window but not if I open the new window by pressing CTRL an clicking the link or using right click "Open link in new window".
Is it only possible to access the window.opener if the window was opened with window.open in NN7?
I have a normal window cotaining a form (named form1). The form has a text input called imageURL. There is a button that, when clicked, opens a new window that contains three frames (left, right and bottom.) In the right frame is another form (named form2) with a hidden input (selected). When form2 is submitted, I want the value of selected to be passed back to the imageURL on form1 and then close. The code I have tried is as follows:
(From my frame...) <SCRIPT language="JavaScript"> function passValues() { // pass variable back to parent window window.opener.document.form1.imageURL.value = document.form2.selected.value; } top.window.close(); </SCRIPT>
It closes just fine, but imageURL on form1 never changes.
The use of jQuery below does not work for IE9 but works beautifully for Firefox, Chrome & Safari. Before I rewrite it without jQuery, I was hoping to get some feedback on what I've done. Not certain about standards compliance, just know it works fine for all the browsers I'm testing except IE.The user provides an action from a popup window. The action references the opener window, removes a few elements from a hidden element and then immediately repopulates those elements with updated values based on that action.
Code JavaScript: // does not appear work like this in IE9 window.opener.$('div#hiddenShiftAbbrList').empty();[code].....
I have a inventory control program written and I use window.opener.location='filename.html' window.close()
It works fine in ie6 on windows 98 and XP home but sometimes for users with XP professional it crashes ie6 (wants to send a error reports to microsoft and the closes)
I was wondering if it could be that professionals "mutil" processing causing a problem by 1 process excuting before the other?
The innerHTML and style.display of the above works. Both col?? and row?? can be targeted and changed. However the img?? does not work. The ID on the tag is fine but the image wont change. Incase it was src I tried with style.display too on the image but still wont target it.
I have a problem that drive my CRAZY! It's about a popup with opener window.
I can't submit the data from the popup window to the opener window. In Mozilla works just fine but when i try on IE 7 the form won't submit. Here si the function!
function copyForm() {
window.opener.document.getElementById('form_name').submit(); //i've try also opener.document.getElementById('form_name').submit(); //and also window.opener.document.form_name.submit(); window.close(); return false; } What i must do to make this code work in IE???
I am trying to use window.opener to grab some innerHTML of and ID in the orginal window. It works great in may tests going from HTML page to HTML page. I need it to work from and HTML Email in Outlook as the opener window. I receive the error that "document is null or not an object". Is this not possible? HTML in Email...
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.
I am new to JavaScript but until now, have felt my way along fairly successfully. I have a page showing an image to the user. I use window.open to open a separate page, listing a bunch of different images that the user can select. When the user clicks "Submit", I'd like the image selection page to close and update the image on the originating page.
To "play around" with this command until I can use it successfully, I wrote the following;
function Button1_onclick() { window.opener.document.bgcolor='bisque' window.opener.location.reload() window.close() }
The line for changing the back ground color to bisque I pulled from the netscape site javascript reference for Window.Opener.
I have a problem that the window.opener variable is lost once my popup page has a postback. On multiple pages they address this problem but I cannot find a correct answer.
This is my situation:
I have a main page which shows invoices. When a user clicks on the invoices they get a popup where they can alter the invoice which uses postbacks because of direct changes in the database. Finally the user can click a button to accept the invoice and then I need to change two variables on the main page which opened this popup, the new invoice fee and status (which is based on the button pressed). I dont want any postbacks on the main page, therefore I simply want to pass these two variables from the popup to the main page.
However, after a single postback on the popup page the window.opener variable is gone and lost forever. Now I have seen solutions using frames but I do not know how to go from there because I also pass some variables from the main page to the popup.
In that poupup window, the user loads a number of different pages (by submitting forms and clicking on buttons), some of which are in a different domain. But eventually, the user comes back to a page that is in the same domain as the page in the main window.
On this page, I'm trying to execute the following script:
Yes, there is a form on the page that has been sitting in the main window this whole time. However, I'm getting an "access denied" error. Any thoughts?