PDA

View Full Version : Having a problem



dmbware
11-08-2007, 08:26 PM
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?

jscheuer1
11-09-2007, 07:20 AM
Looks like a mess. This works:

page1.htm

<!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

<!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:


<script type="text/javascript">
this.name='bobo_1';
</script>

off of page1 and put this on page2:


<script type="text/javascript">
opener.name='bobo_1';
</script>