need help in coding

Discussion in 'Blogging' started by chander, Jul 16, 2011.

  1. chander

    chander Registered Member

    Joined:
    Jul 6, 2011
    Messages:
    99
    Likes Received:
    5
    Location:
    India
    i am looking for some java script code, what i am looking to di is, when someone exit my websites a popup window appears and after hitting the ok button one another url should open...how could i do that i have tried with the following code..

    Code:
    <html>
    <head>
    <script type="text/JavaScript">
    function ExitPage()
    {
    alert ('Thank you for visiting our site.');
    }
    
    function load(url)
    {
    window.open(url,'_blank','scrollbar=yes') ;
    }
    </script>
    </head>
    <body onbeforeunload="ExitPage();">
    </body>
    </html>
     
    Last edited: Jul 16, 2011
  2. supparman

    supparman Newbie

    Joined:
    Jul 22, 2009
    Messages:
    28
    Likes Received:
    5
    call load function in your exitpage function
     
  3. chander

    chander Registered Member

    Joined:
    Jul 6, 2011
    Messages:
    99
    Likes Received:
    5
    Location:
    India
    can u please explain a little more ,

    where i have to put that load function
     
  4. supparman

    supparman Newbie

    Joined:
    Jul 22, 2009
    Messages:
    28
    Likes Received:
    5
    Code:
    <html>
    <head>
    <script type="text/JavaScript">
    function ExitPage() { 
    alert ('Thank you for visiting our site.');
    window.open('http://www.google.com','_blank','scrollbar=yes');
    }
    </script>
    </head>
    <body onbeforeunload="ExitPage();">
    </body>
    </html>
    
     
    • Thanks Thanks x 1
  5. chander

    chander Registered Member

    Joined:
    Jul 6, 2011
    Messages:
    99
    Likes Received:
    5
    Location:
    India
    this is working only with IE and when allow the pop up :(