[thelist] javascript help

Simon MacDonald simonmacdonald at uk2.net
Sun Jun 26 06:41:41 CDT 2011


Bob,

Is this the sort of thing you want - not my code - I found ages ago and use
it now and then for opening and closing windows.
The closeWindow seems to have the bit of code you might use ....it checks to
see if the window is open before closing it, you could add your own code in
there.

Cheers Simon

var windowHandle = null;
var windowHandle_closed = false;

function openWindow() {
    windowHandle =
window.open('http://www.example.com/','windowName','height=200,width=200');
    if (windowHandle_closed) {
        windowHandle_closed = false;
    }
}

function closeWindow() {
    if (windowHandle != null) {
        if (!windowHandle_closed) {
            windowHandle_closed = true;
            windowHandle.close();
        }
    }
}

-----Original Message-----
From: thelist-bounces at lists.evolt.org
[mailto:thelist-bounces at lists.evolt.org] On Behalf Of Bob Schwartz
Sent: 26 June 2011 9:36 AM
To: thelist at lists.evolt.org
Subject: [thelist] javascript help

Would someone be so kind as to give me a hand with a simple javascript?

What I need is a js that checks to see if a pop-up window has been opened as
a pop-up or not, and if not, write a link.

i.e - if opener is null, then write http:///www.mulink.com, else do nothing.
-- 

* * Please support the community that supports you.  * *
http://evolt.org/help_support_evolt/

For unsubscribe and other options, including the Tip Harvester
and archives of thelist go to: http://lists.evolt.org
Workers of the Web, evolt ! 
 

__________ Information from ESET Smart Security, version of virus signature
database 6239 (20110626) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 
 

__________ Information from ESET Smart Security, version of virus signature
database 6239 (20110626) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 



More information about the thelist mailing list