Results 1 to 2 of 2

Thread: Having a problem

  1. #1
    Join Date
    Jul 2007
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Having a problem

    I am using the following code:

    <script language="JavaScript">
    <!--


    function getBoxList ()
    {
    self.window.opener.location='BestBuyIDX.html';

    self.opener.focus ();
    window.close ();




    }

    //-->
    </script>

    The problem with this code, is that I click a link from an Iframe, that opens a new window that contains this code. When the user clicks on close window, its suppose to close the window and take the user to the bestbuy section of the web site... It instead loads the bestbuy page in the iframe. How do I point to reload over the entire page?

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Looks like a mess. This works:

    page1.htm
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <script type="text/javascript">
    this.name='bobo_1';
    </script>
    </head>
    <body>
    <a href="page2.htm" onclick="open(this.href,'_blank','width=300, height=300');return false;">Page 2</a>
    </body>
    </html>
    page2.htm
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    
    </head>
    <body>
    <a href="http://www.google.com/" onclick="window.open(this.href,'bobo_1');self.close();return false;">Google then Close</a>
    </body>
    </html>
    Alternatively, you can take:

    Code:
    <script type="text/javascript">
    this.name='bobo_1';
    </script>
    off of page1 and put this on page2:

    Code:
    <script type="text/javascript">
    opener.name='bobo_1';
    </script>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •