Solved

Close popup when leaving the page

Posted on 2001-08-22
48
312 Views
Last Modified: 2012-06-22
Hi guys
On our 3 frames webpage. Logo, menu & main. Some pages in the main frame call the odd popup window with the following kind of JS:
<!-- --><script LANGUAGE="JavaScript"><!--
window.open("newsflsh.htm", "ascnf", "width=400,height=220");
//--></script>
The info in the popup relates to the topic of several different main pages which can be changed by a sub-menu.
I would like to automatically close the popup when the visitor clicks on an other available topic in the menu frame which will open a new page in the main frame and a new sub-menu in the menu frame. The new main page opens again a new topic related popup.
This is to avoid numerous windows floating about behind the active screen window.
Thanks guys, Edi
0
Comment
Question by:egbservices
  • 15
  • 13
  • 11
  • +1
48 Comments
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6415779
You need a pointer to the popup so pen it this way:

var x=window.open(etc...)

Then in the body of the page that open it put:

<body onUnload="if (x) x.close();">


I think that should do it.

Cd&
0
 
LVL 10

Expert Comment

by:dij8
ID: 6415792
First you will need to assign a variable name to your popup windows:
<!-- --><script LANGUAGE="JavaScript"><!--
topicwin = window.open("newsflsh.htm", "ascnf", "width=400,height=220");
//--></script>


Then you will need an onunload function in your body tag:
<body onunload="closewindows()">

Which will in turn need a script that closes all open windows.
<script language="JavaScript">
function closewindows() {
  if (topicwin) {
    if (topicwin.closed) {
      topicwin.close()
    }
  }
}
</script>

You will need to run through each and every possible variable name you have assigned to open windows.  If they haven't been opened or have already been closed then it shouldn't cause any problems.  This is worth checking first though.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6415845
Ahem...

It has an error anyway.  If you are going to test for open,
then if (topicwin.closed)
should be if (!topicwin.closed)

In any case functionally the same.

It should not be necessary to check for multiple popups, if only one per page is opened, and only the mani page opens them.

Cd&

0
 
LVL 2

Author Comment

by:egbservices
ID: 6416108
Hi Cd&

So if I change the JS to...

<!-- --><script LANGUAGE="JavaScript"><!--
var ptrasc=window.open("newsflsh.htm", "ascnf", "width=400,height=220");
//--></script>

do I have to place the...
<body onUnload="if (ptrasc) ptrasc.close();">
on the page which opened the popup or is it possible to place this 'onUnload' in the menu page.
Reason being there are several main page changes for one topic and only the 1st one (ascindex) opens the popup. Thanks mate
0
 
LVL 10

Expert Comment

by:dij8
ID: 6416654
If you put the onunload in the body tag of any page then the window will close when THAT page is closed.  In a framed situation it would happen as you go through the various pages of your site.

If you are always going to have the same menu page open then this is probably the best place to put your onunload.  Which is why I said you needed to go through each and every window variable you create.  If you use the same variable name each time then only one window will open and the content will change.  Otherwise you can have lots of open windows.
0
 
LVL 2

Author Comment

by:egbservices
ID: 6416972
Hi dij8
Thanks for you input.
I have already played with one popup window and contents change. The problem there is that the popup window will stay in the back ground when the contents changes, unnoticed! This problem requires some other JS which will put the window up front on contents change. I really want to keep it as simple as possible.
Also the main pages of the individual topics can be called and opened without frames (no menu frame & no logo frame). Each topic index page has a pull down menu to goto any other page of this topic. 'Back' will take you back to this index page. It's not possible and necsessary to go to a different topic from any main page. The popup window in this case can therefore stay behind.
Only in the frame setup where you can jump to any topic I would like to close the topic related popups.
0
 
LVL 10

Expert Comment

by:dij8
ID: 6417105
What you are asking is all possible.  But very difficult for the whole code to be written for you here.  So the best is little bits and pieces that you may want to work with until you get the desired result.

As has been said opening a window requires a variable if you want to do anything to that window later (close, move, resize, focus, et c.).  If you have any problems with this then play with decalring it as a variable and not.  I find it works better when you don't (although that doesn't make sense and I am not sure why):
ptrasc=window.open("newsflsh.htm", "ascnf", "width=400,height=220")

Once the variable is set you can do what you want to the window by applying it to the variable.  If you change the location or try to open another window using that same variable then the content will change but a new window will not open (assuming the previous window is still open).  Use this to your advantage.  If you want to replace content then you can.  If you need yet another window then use a different variable.  Too many windows for the user does get annoying though.

Changing content can be as simple as ptrasc.location = "newpage.htm" but this can only be done if you are sure the window is there and open.

If you use the same script as above (ptrasc=window.open...) then this will change the content if it is there and will open a new window if it isn't.  If it is there though, as you have discovered, it happens in the background.  So then you need to focus on the window:
ptrasc.focus()

If you need more Cd& and I should be able to help out.
0
 
LVL 10

Expert Comment

by:dij8
ID: 6417142
Thought of something else.  If you want to close a window only after the user has left the site completely rather than when the page is unloaded (which will happen when they go to the next page) then you could have a script that checks the URL for certain details.  Like the web site host:
function closewindows() {
  if (top.location.href.indexOf("dij8.com")<0) {
    if (topicwin) {
      if (topicwin.closed) {
        topicwin.close()
      }
    }
  }
}
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6417207
Did it again if (topicwin.closed)  should be if (!topicwin.closed)

If you want to keep the popup on top you can do something like this as well:

var ptrasc = window.open(etc...);
var ST= setInterval('setfocus()',1000);
function setfocus()
{
   if(ptrasc)
   {
       if(!ptrasc.closed)
       {
           ptrasc.focus();
       }
       else
       {
          clearInterval(CT)
        }
    }
}

The time value can be set to anything.  As it is it will check to see if the popup is on top once a second.

You can stop checking for it anytime with
clearInterval(CT);
and it will stop checking automatically if the popup gets closed.

Cd&

 
0
 
LVL 10

Expert Comment

by:dij8
ID: 6417499
Guess I should watch the cut and paste. :-(  Thanks for the sharp eyes Cd&.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6417512
My biggie is = instead of == all the time.  

Cd&
0
 
LVL 2

Expert Comment

by:TenTonJim
ID: 6418472
create a function in your pop up window that asks to close the window, then in the body tag of the pop up window, call it using "onBlur".

<script language="javascript">
function closeMe(){
window.close
}
</script>

<body onBlur="closeMe();">

so when the user sets the focus anywhere other than the pop up, the pop up will close.

Jim S.
0
 
LVL 2

Author Comment

by:egbservices
ID: 6420112
Hi guys
Thanks for all of your immediate and smart inputs. As my normal day's work does keep me on the toes you have to bear with me and give me some time to apply all your js and test them with NS and IE.

Cd&, dij8 & Jim S. I will let you know as soon as I have successfully modified the pages... :-)

Did you know:
Great minds discuss ideas;
Average minds discuss events;
Small minds discuss people.

Learn from the mistakes of others.
You can't live long enough to make them all yourself.
0
 
LVL 2

Author Comment

by:egbservices
ID: 6420894
Hi Jim S
I have quickly tried your onBlur with a popup but it does not want to work. What am I doing wrong.
I put...
<script language="javascript">
function closeMe(){
window.close
}
</script>
</head>
...in the header and the rest here...
<body onBlur="closeMe();" topmargin="0" leftmargin="0" MARGINHEIGHT=0 MARGINWIDTH=0>
<table BORDER=0 CELLSPACING=0 CELLPADDING=0 COLS=1 WIDTH="200">
<tr>............. etc.
is this not the way to do it?
0
 
LVL 2

Expert Comment

by:TenTonJim
ID: 6420969
Sorry man this one works for sure...

<html>
<head>
<title>Egg on Jim's Face</title>
</head>
<body onLoad="self.focus();" onBlur="self.close()">
<p>Jim has an itchy trigger finger.</p>
<a href="javascript:window.close();">close Window</a>
</body>
</html>Jim S.
0
 
LVL 2

Expert Comment

by:TenTonJim
ID: 6420980
maybe when nobody is watching...someone could put that into that "Stop Pop Up Windows" ad on the opening page here...:)

Jim S.
0
 
LVL 2

Author Comment

by:egbservices
ID: 6421455
Jim S
I place the following 2 lines in the popup...
body onLoad="self.focus();" onBlur="self.close()">
<a href="javascript:window.close();"></a>
it makes it disapear ok when I click anywhere else... but when I click on the link on the popup which should forward the main page to a specific target it goes too but before the main page has changed. Any idea why?
0
 
LVL 2

Expert Comment

by:TenTonJim
ID: 6421520
ok sorry i misunderstood you want to close window and move main window to new url... ( I think )
this works for that:

<html>
<head>
<title>Page redirects and then closes</title>
<script language="javascript">
function timeoutClose() {
     setTimeout("self.close()", 500); // pauses briefly
}

function showlink(url) {
    opener.location.href = url;// says whatever opened me gets the action
}

</script>

</head>

<body>
###### fill in the appropriate link here below #########


<a href="javascript:showlink('theMainWindow.htm')" onClick="timeoutClose();">Close and Go to Some Page in Main Window</a><br><br>


##############     or close the window  ##############
<a href="javascript: window.close();">Close Window</a>

There that should do it    :-)

Jim S.

</body>
</html>
0
 
LVL 2

Expert Comment

by:TenTonJim
ID: 6421533
04:00AM Seattle Jim S is going to bed have to be at real job at 07:00

  |:-(


Till then good Luck egbservices ...

Jim S.
0
 
LVL 2

Expert Comment

by:TenTonJim
ID: 6421536
>   ( I think )
this works for that:


I know that works it just came out funny on the screen.

Jim
0
 
LVL 2

Author Comment

by:egbservices
ID: 6421565
Cd& & dij8
I have now changed the js in the main page of the frame to...
<!-- --><script LANGUAGE="JavaScript"><!--
var ptrasc=window.open("newsflsh.htm", "ascnf", "width=400,height=220");
//--></script>

In the menu page of the frame I added...
<body onUnload="if (ptrasc) ptrasc.close();">
... at the end!

The popup opens ok but when the menu page changes to a different one it does not close! Where did I make the mistake?
0
 
LVL 2

Author Comment

by:egbservices
ID: 6421672
Cd& & dij8
I have now changed the js in the main page of the frame to...
<!-- --><script LANGUAGE="JavaScript"><!--
var ptrasc=window.open("newsflsh.htm", "ascnf", "width=400,height=220");
//--></script>

In the menu page of the frame I added...
<body onUnload="if (ptrasc) ptrasc.close();">
... at the end!

The popup opens ok but when the menu page changes to a different one it does not close! Where did I make the mistake?
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6421691
>>>... at the end!

At the end of what.  The onUnload should just be in the regular body tag.

Cd&
0
 
LVL 2

Author Comment

by:egbservices
ID: 6421693
Good morning Jim... hope you had a short but good nights sleep... ;-)
With my limited JS knowledge I got as far as...
---------------
<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
   <meta name="Author" content="Edi Brandli">
   <meta name="GENERATOR" content="Mozilla/4.75 [en] (Win95; U) [Netscape]">
   <meta name="description" content="The Lightning Party">
   <meta name="keywords" content="Auckland Swiss Club">
   <meta name="Reply-to" content="webmaster@swiss.org.nz">
   <meta name="distribution" content="global">
   <title>The Lightning Party</title>
</head>
<script language="javascript">
function timeoutClose() {
setTimeout("self.close()", 500); // pauses briefly
}
function showlink(url) {
opener.location.href = url;// says whatever opened me gets the action
}
</script>
</head>
<body  topmargin="0" leftmargin="0" MARGINHEIGHT=0 MARGINWIDTH=0>
<table BORDER=0 CELLSPACING=0 CELLPADDING=0 COLS=1 WIDTH="200">
<tr>
<td WIDTH="100%" BGCOLOR="#FFFFCC">
<center><b><font face="Cricket"><font size=+1>The Light is at the</font></font></b>
<br><b><font face="Cricket"><font size=+1>Swiss Farm!</font>&nbsp;</font></b></center>
</td>
</tr>

<tr>
<td>
<center>

<a href="javascript:showlink('program.htm#stammtisch')" target="main_window" onClick="timeoutClose();"><img SRC="images/light.jpg" ALT="Come to the Stammtisch!" BORDER=0 height=150 width=200></a>

<!-- <a href="program.htm#stammtisch" target="main_window"><img SRC="images/light.jpg" ALT="Come to the Stammtisch!" BORDER=0 height=150 width=200></a> -->

</center>
</td>
</tr>

<tr>
<td WIDTH="100%" BGCOLOR="#FFFFCC">
<center><b><font face="Cricket"><font size=+1>and the parties are on!</font></font></b></center>
</table>
<a href="javascript:window.close();"></a>
</body>
</html>
-----------------
... and it still does not do what I want it to do.
May be any of you guys can check above code for mistakes.

PS: When all the popup functions work I will give each one of you guys 100pts if that's ok with you!
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 2

Author Comment

by:egbservices
ID: 6421721
Hi Cd&
Don't you go to bed in Canada or are you up so early!!

I placed the onUnload at the end of the page... :-?

Do I have to add as shown below...

<body onUnload="if (ptrasc) ptrasc.close();" text="#000000" bgcolor="#FF0000" link="#FFFFFF" vlink="#FFCCCC" alink="#FFCCCC">

if so it still does not close the window when the menu changes... :-(

May be you can give me some more proffessional hints... ;-)
0
 
LVL 2

Author Comment

by:egbservices
ID: 6421755
Hi Cd&
Don't you go to bed in Canada or are you up so early!!

I placed the onUnload at the end of the page... :-?

Do I have to add as shown below...

<body onUnload="if (ptrasc) ptrasc.close();" text="#000000" bgcolor="#FF0000" link="#FFFFFF" vlink="#FFCCCC" alink="#FFCCCC">

if so it still does not close the window when the menu changes... :-(

May be you can give me some more proffessional hints... ;-)
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6421990
Okay now you have in the right spot.  It's just an event in the body.

You have the unload on the same page that is opening the popup, right?
Because you need to close it from the same pae that opened it.

If the menu frame is opening it then we will need to close it when
we link to a new page for the main frame.

BTW,

Dinosaurs are early risers and this time of year we like tt catch the
early morning sun.

Cd&
0
 
LVL 10

Expert Comment

by:dij8
ID: 6422298
I was up before all of you (being at least 5 hours ahead, and therefore probably to bed 5 hours before you as well) and spending a day looking for a real job (which I got :-) ) I end up coming back to an exponentially grown thread.  Cd&'s comment about opening the browser and closing it from the same page is important.  A variable created will not be seen in another page.  It can be accessed from another page though if the right path is used.  And this includes frames.

Placing the script in the frameset page can be accessed by using top.functionname() or top.variablename

If you place all your scripts in the menu frame you can access them from other frames by using the syntax top.menu.functionname() or top.menu.variablename
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6422451
Yeah, that was why i asked.  I almost never use frames, so I initially
never even though about having to go cross-frame.

BTW,

I think Brisbane is about GMT +10, so egb probably has a day's work
done by the time you drag yourself out of bed.  It's already early
Saturday morning there. We are really spanning the globe on this one.

Cd&
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6422498
I think we can still do the scripts in the frame pages though.  parent.frames.framename.functionname()
or parent.frames.framename.document.functionname() perhaps.  To do it that way you have to use a function, you have to use a function, it won't let you reference methods that way for some reason.

There still could be a security issue either way (frameset or frame).  If any of the pages come from a different domain then access will be denied if the cross-frame reference also goes cross-domain.

Cd&
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6422503
Oh and I jsut noticed: "a real job (which I got :-) )"

Congrats...

Cd&
0
 
LVL 2

Expert Comment

by:TenTonJim
ID: 6422608
OK.. just so I understand what is supposed to happen.

Is the link that calls the pop up in the same frame as what the pop up is supposed to target for the <a> tag, or is that a different frame, or is it 2 frames that is targeted?

I am getting a complex here.. I have read your question over and over. The white flag cometh...

Is it possible to restate the question in a different way? Sorry but I really want to get the thing "figgered" out for me as much as for you :]

Make that a quad shot latte please...

Jim S.
0
 
LVL 2

Expert Comment

by:TenTonJim
ID: 6422627
OK.. just so I understand what is supposed to happen.

Is the link that calls the pop up in the same frame as what the pop up is supposed to target for the <a> tag, or is that a different frame, or is it 2 frames that is targeted?

I am getting a complex here.. I have read your question over and over. The white flag cometh...

Is it possible to restate the question in a different way? Sorry but I really want to get the thing "figgered" out for me as much as for you :]

Make that a quad shot latte please...

Jim S.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6422840
Morning Jim,

Time for the West coast shift? :^)

Cd&
0
 
LVL 2

Expert Comment

by:TenTonJim
ID: 6423067
This feels like working in a 7-11. *yawn*
0
 
LVL 2

Author Comment

by:egbservices
ID: 6423977
It's Saturday and I just got out of bed had brakfast and... I guess my popup idea Is not easy to explain exactly so everyone understands what I want to do as there are different popups in question. I will try again and also give you the link to the site I keep playing with so you can see the beginning of it.
The popups, good or bad, were requested by the owner of the page, the Swiss Society of NZ, as a small feature to highlight an event, an other URL related to them, some private questions, feedback links, etc. The Society is made up of different Clubs and Groups and therefore we want popups which target the correct group only.
Does it make sense so far.

All I want to do is minimise the number of open poppup windows, make them disapear if disgarded or if necsessary make the come up front every 2-5 seconds as long as the visitor stays on a when

When you open the site, the 1st popup will popup ;-). This is a link to an other URL in Switzerland and when you click on it a new page (target"_blank") should open. At the same time the popup should vanish and you simply end with the new windows on top of the societies page. If you do not click on it and simply continue surfing the Society page it should disapear too. This popup is triggered with a JS in the main_window.

Next , in the menu, click on Auckland please. All 3 frames change to the Auckland Swiss Club page. A new popup will popup triggered by a JS in the main_window. This popup can be used by club members, the Auckland committee to announce something, etc. The popup may or may not contain a link to open a new page in the main_window. Clicking on should action the change in the main_window. The popup though can stay behind until the visitor goes to a different clubs pages on the menu or leaves the the Society page for all together. If the popup contains an important message I might consider Cd& idea to make the popup come back up front, say every 3-5 seconds. Also the contents of this popup could change when the visitor goes to a different page off this club.

Next click in the menu on the Program link. A small popup, The Light is at the Swiss Farm, pops up. This popup contains a #target link to an repeat program event item within the program page . When the visitor clicks on it the program page should jump to that target. The popup can vanish after this. If the visitor simply ignors it and continues scrolling the program page, it should vanish too (onBlur).
The previous popup is still there behind the main window until you change to an other club... lets say Taranaki. By then all Auckland popup should have vanished and made room for new popups with Taranaki info and highlights.

The URL for this challenge is http://swiss.org.nz
I am simply the voluntary Webmaster and do this job as a hobby and a way to learn as much as possible about Webdesign. I don't get payed for this work and therefore have to freedom to add many cool features to this page without anybody looking over my shoulder.... as long as I keep them, the Society, happy too ;-)
Please just tell me if I have to 'pay' you guys more points for your effort and sleepless nights...
Now it's time for a cooooooooool beer. Cheers everyone! Edi
0
 
LVL 10

Expert Comment

by:dij8
ID: 6424541
I was writing comments for this just after you posted your last comment and while surfing your site it crashed my IE.  Being the early hours I gave up and went to bed.  So I'll comment again.  Hopefully I'll cover everything I had already written before.

The first one is easy.  In the popup you can add a timed closing.
<body onload="setTimeout(top.window.close(),5000)">
The number there is milliseconds (so the above one is five seconds).  If the window gets closed before five seconds then obviously this script won't run, or need to.  In your link you can add an onclick event.
<a href="otherpage.htm" target="_blank" onclick="top.window.close()">other page</a>

The second one should be easy enough if you follow variations of what has been said above.  Mostly though this demonstrates the need to have the script in the frameset page.  Or at least in a page that doesn't change throughout the site (like the top right frame with the aninmated flag (the best flag in the world I might add ;-) ))  Then you would add a close the window script to the body onunload tag to any and all of the most common pages (again most likely to be the top right frame).  Any  onload script that references the window variable (by accessing the script in the frameset page) will open a new one if it isn't already open or change the content if it is already there.

The #target one wouldn't really be any different to any of what has already been covered (unless you want to know how to move to the # reference).

Changing clubs should either replace the content of the open popup windows by using the same variable name for the windows or you could use different variable names for each club.  e.g. AKptrasc=window.open...  TNptrasc=window.open... et c.  The latter would require much more work regarding making sure all the right windows are closed because you won't be able to tell which clubs the user has been to which means you would always have to check for all the clubs pages.

Next point is where you have "best viewed with Netscape"  Lose that!  Nothing is best viewed with Netscape.

Last point is what are you doing drinking a beer after breakfast?  You are in Aussie.  You should be having your first beer BEFORE breakfast.
0
 
LVL 2

Author Comment

by:egbservices
ID: 6424592
Hi dij8
It's now bed time again for us in Oz.... beer before breakfast....!?!? Sure but you must be a 'fair dinkum' Aussie for that.
I have applied your 1st comment to the 1st popup as follows...

</head>
<body onload="setTimeout(top.window.close(),30000)" topmargin="0" leftmargin="0" MARGINHEIGHT=0 MARGINWIDTH=0>
<table.......... etc.
.
.
.
<a href="http://www.swissfocus.ch" target="_blank" onclick="top.window.close()"><img SRC="images/aso.jpg" ALT="Click here and visit us!" BORDER=0 height=400 width=150></a>
.
.
.
I hafe chosen 30 sec. because the popup closes very fast, actually just after it has opened. Maybe you can check it quickly too... http://swiss.org.nz It doesn't even give me time to click on it! Any reason why?
May be I had one drink to many, this Saturday night, and should not play with the webpage any more.... ;-)

PS: I prefer the "Best viewed with NS" cause I don't like Gill Bates and his Misrocoft IE stuff.... my personal choice though... ;-)
0
 
LVL 10

Expert Comment

by:dij8
ID: 6424805
I ain't no Aussie.  And I usually only let people get that one wrong once.  Auckland (North Shore) born and bred.

The closing immediately thing was my mistake.  You need quotes around the function called by the timeout.
setTimeout('top.window.close()',30000)

And of course, be wary of quotes inside quotes.  In this case you will need single quotes in the timeout because they are inside double quotes of the onload.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6424891
Okay,

Frameset is definitely where we are going to have to go with the functions, as our now wmployed friend said.  I like the idea of reusing the same window.  You don't have to do a replace if you do an open on a window that is already open it works just liek a replace.

The timeout approach could actually be used on all the windows with a high value say 30 or even 60 secoonds.  That elimnates the need to close along the way.  

Now for anything you want to keep on top just include a forced forced focus interval right in the body of the popup like:

<body onLoad="ontop=setInterval('self.focus()',1500)">

That will make it re-assert itself every 1.5 seconds.  If at anytime you want to let it stay blurred just clear the interval with: clearInterval(ontop)

As for breakfast.  Try the Canadian method.  A double whiskey to clear the head.  Then the beer after breakfast, though if it's a work day and you are rushed you can have the beer with breakfast, so you don't have to down will driving into work.

Cd&
0
 
LVL 2

Author Comment

by:egbservices
ID: 6425796
Hi guys
dij8... Auckland (North Shore) born and bred!! Small world... next you tell me you live in Glenfield!! I lived in Stanley Road. Glenfield for 20 years and my last 'real' job was in Mairangi Bay! Never know we might have met somewhere in a pub...

The time out... setTimeout('top.window.close()',30000) works fine now but when I use below code to click and close the popup it only just closes it without opening the new page!
<a href="http://www.swissfocus.ch" target="_blank" onclick="top.window.close()"><img
SRC="images/aso.jpg" ALT="Click here and visit us!" BORDER=0 height=400 width=150></a>

Cd& your idea with the timeout approach which elimnates the need to close the windows along the way is not bad. The simpler the better. After always have to remember where I paced the code which does the job...!

Jim's onBlur will be used for the popups which contain less important popup info...

So far so good... I have to go now and play with my off-spring... :-)

You guys did a good job and I will accept one comment as answer and place 2 more questions to give 100 points each to the other two!
See you later! Edi
0
 
LVL 10

Accepted Solution

by:
dij8 earned 100 total points
ID: 6426070
Beachhaven, sort of Lancaster Rd.  I know Stanley Rd but can't remember where it is exactly.  (for Cd&'s and Jim's benefit, Beachhaven and Glenfield are suburbs that share a border)

You could try changing the onclick event to onclick="top.window.close();return true;"  This should then open the other window.

The collaboration here is a perfect example of why experts should make comments and not answers.  :-)  And the ongoing pointers demonstrate why it is a very good idea for the original question asker to participate. :-)  Hope this thread makes you happier than your other needed responses yesterday Cd&.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6426412
>>>The collaboration here is a perfect example of why experts should make comments and not answers.  :-)

I think every top-expert in the TA feels that way.  probably why it so peaceful here.... wel most of the time anyway, except when the dinosaur starts chasing down old Qs.

How come there are so many swiss in New Zealand?  

Cd&
0
 
LVL 10

Expert Comment

by:dij8
ID: 6426486
The Swiss are obviously an intelligent people. :-)  Maybe they consider it a time of your life thing.
0
 
LVL 2

Author Comment

by:egbservices
ID: 6427158
Hi guys
Swiss are every where on this world just not gathering in big, ethnic bunches. Cd& if you look around your city you will be surprised how many there are.
And yes dij8, many Swiss are intelligent ;-)... and get volunteers to their work. Being a Swiss by hart, living in Oz and travelling on a NZ Passport, I don't mind!
B.t.w. the popups work fine now :-) now I can add many more!!
I will accept dij8 last comment as an answer and place two more questions, for Cd& and Jim.
Thanks guys for all your great input. You the sort of EE core members which make this global site professional and fun at the same time. Edi
0
 
LVL 2

Author Comment

by:egbservices
ID: 6427165
Have a good day mate...
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6427175
Glad we could help, Eh!  :^)

Cd&
0
 
LVL 10

Expert Comment

by:dij8
ID: 6427189
It has been a fun thread.  Glad to help.  And thanks for the A.

Cd&, Ed is in Queensland now so as much as "Eh" would work for a Canadian or a Kiwi, up there it is "Yeah".  Sydney is "Mate".  Melbourne is "Eh" (although also "Mate").  And Tasmania is "Yeah eh mate". :-)
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
use month from current date as default for select list 3 27
2 CSS questions 11 36
CSS measurement 10 17
Disabled form text field 2 0
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

747 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

13 Experts available now in Live!

Get 1:1 Help Now