473,320 Members | 1,958 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,320 software developers and data experts.

window.opener issue

hello,

i have this page where if you leave the page or close the page a pop-up will generate. the pop-up has a button on it to go back to that original page. the code i have works fine if the user just leaves the main page, but i can't figure out how to get it to regenerate the page if the user closes the main page. if that makes any sense and you have some ideas, let me know.

thanks,
derek


i have the following script on my page:

<script language="JavaScript">
function goto_application()
{
window.opener.focus();
window.opener.location.href='www.google.com';
window.close();
}
</script>

and then the link looks like this:

<a href="javascript: goto_application();">click here</a>
Feb 13 '07 #1
3 1508
r035198x
13,262 8TB
hello,

i have this page where if you leave the page or close the page a pop-up will generate. the pop-up has a button on it to go back to that original page. the code i have works fine if the user just leaves the main page, but i can't figure out how to get it to regenerate the page if the user closes the main page. if that makes any sense and you have some ideas, let me know.

thanks,
derek


i have the following script on my page:

<script language="JavaScript">
function goto_application()
{
window.opener.focus();
window.opener.location.href='www.google.com';
window.close();
}
</script>

and then the link looks like this:

<a href="javascript: goto_application();">click here</a>
This is not a Java question. I will move it to the Javascript forum.
Feb 13 '07 #2
This is not a Java question. I will move it to the Javascript forum.
thanks, sorry!
Feb 13 '07 #3
acoder
16,027 Expert Mod 8TB
hello,

i have this page where if you leave the page or close the page a pop-up will generate. the pop-up has a button on it to go back to that original page. the code i have works fine if the user just leaves the main page, but i can't figure out how to get it to regenerate the page if the user closes the main page. if that makes any sense and you have some ideas, let me know.
When the window is closed, window.opener does not exist anymore. So you will have to open another window.
So try the following code:
Expand|Select|Wrap|Line Numbers
  1. function goto_application()
  2. {
  3.     if (window.opener) {
  4.         window.opener.focus();
  5.         window.opener.location.href='www.google.com';
  6.     } else {
  7.         window.open(...) // your window.open code (you know how to do that!)
  8.     }
  9.     window.close();
  10. }
Feb 13 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Carol Lyn | last post by:
Could use your assistance with this. I have a window that opens via onclick and it is a small window with info about a site. If the user is interested in visiting that site, there is a link to...
3
by: NeverLift | last post by:
But, if it's not open, I don't want to open it . . . using window.open will open it if it doesn't exist, even if the url in that open is null (the window is then empty -- but it's open). The...
2
by: Stefan Sch?rmeli | last post by:
I already read about several problems using firefox and the window.opener property. But obviously it didn't help out. So here is my problem: I got a "Search..." link which opens a new window...
2
by: Snolly | last post by:
Hi all, Here is my issue. I have a web page (lets call it page1) with an iframe in it that then opens a pop-up window (page2). The pop-up window is used to edit some data that was loaded into...
14
by: D. Alvarado | last post by:
Hello, I am trying to open a window containing an image and I would like the image to be flush against the window -- i.e. have no padding or border. Can I make this happen with a single call to a...
3
by: JohnEGee | last post by:
Hello, all, and TIA for any help you can offer. I've searched the Internet for answers and have finally come here. I've created a page (several, actually) with a link that opens a pop-up...
5
by: asadhkhan | last post by:
I have the following code which works correctly in IE 6, but in IE 7, Fire Fox 2.0 and Netscape 8 it does not work. I have a main page where a button calls this pop-up and uploads a file once you...
1
by: Vexander | last post by:
Hi I am trying to right a script that closes a popup and then refreshes the pener to specific URL If have this that works form me <script type="text/javascript"> ...
16
by: CreativeMind | last post by:
hi, i have a page calendar.aspx which returns selected date i.e window.returnValue=selectedDate; window.close(); it works fine with IE but not for Firefox. i tried...
3
by: Asterix | last post by:
Hi Guys, I know this is probably an easy one, but I am having issues. Basically, I have a pop-up (child) that controls the parent window. Clicking on a link on the child window should redirect...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.