SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member thomas1's Avatar
    Join Date
    Feb 2001
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Popup & redirection

    I admit I have no idea about Javascript and would like to inquire if there's any way to achieve the following: I have a popup window that opens when clicking a link on A.html. The popup contains some text and a link that 1.) closes the popup window onClick and 2.) redirects the original A.html to B.html.

    I know how to create popups and how to close the popup window onClick, but for the rest I am clueless...
    Last edited by thomas1; Aug 20, 2001 at 06:07.

  2. #2
    SitePoint Zealot
    Join Date
    Dec 1999
    Posts
    137
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The link to close the popup and redirect to page B could be something like this:

    <a href="#" onclick="javascript:window.opener.location.href='./b.htm';self.close();">Close popup and redirect to page B</a>

    If you think that link is a mess, simply create a function like this:

    <html>
    <head>
    <script>
    function closeWin(){
    window.opener.location.href="./B.htm";
    self.close();
    }
    </script>
    </head>
    <body>
    <a href="#" onclick="closeWin()">Close popup and redirect to page B</a>
    </body>
    </html>

    You can see this code working here

    Hope that helps

  3. #3
    SitePoint Member thomas1's Avatar
    Join Date
    Feb 2001
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Muchas gracias, that was exactly what I needed!


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
  •