SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Guru
    Join Date
    Nov 2000
    Posts
    741
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    What does this code do?

    Please forgive me but I know very little about javascript but need to konw what this code does:

    Code:
    <script language="JavaScript">
    var exit=true;
    function exitwindow()
    {
    var url = 'http://www.thankyoupath.com/product.php?id=2babae1ec6-e3a5708fcb-9683ae5f0e-45562cfb27';
    var win = 'toolbar=0,directories=0,menubar=0,scrollbars=1,resizable=1,width=800,height=600';
    
    if (exit)
    open(url,'WindowName',win); }
    
    </script>
    Can any kind soul tell me?

    Thanks,

    Jon

  2. #2
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It tries to pop up a window containing the specified URL.

    From the name, I'd say it's one of those utterly annoying pop-ups some site subject their visitors to when they leave the site. Fortunately, any decent pop-up blocker will stop this.
    Birnam wood is come to Dunsinane

  3. #3
    SitePoint Guru
    Join Date
    Nov 2000
    Posts
    741
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Does it only try to popup the window when you leave the page? Or when you enter?

  4. #4
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's impossible to say from that code fragment. It's a function that opens a pop-up window if the global variable exit does not evaluate to false.

    My guess is that it's intended to be called somewhere along these lines:
    HTML Code:
    <body onunload="exitwindow();">
    Unless you add a call to it somewhere on your page, the code you posted won't do anything at all.
    Birnam wood is come to Dunsinane


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •