• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 497
  • Last Modified:

Pop Up Window - Focus and Close

I'm trying to pop up a window from a navigation window.  When the user minimize it and click on another link from the navigation window the content window should focus and display the right page. When the user close the content window and click on another link in the navigation window it should reopen the content window.

The code below works fine with Netscape 4.6 but I have problems with Iexplore 4.  I have "Access is denied" and "RPC server is unavailable" errors.


<html>
<head>
<title></title>
<script language="JavaScript">
<!-- //
        var NaviWin=null;

        function openNavi(theURL)
        {      
                if((NaviWin==null)||(NaviWin.closed))
                {
                        NaviWin=window.open(theURL,'popupwin',"toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=800,height=600");
   
                }                
                else
                {      
                        NaviWin.focus();
                        NaviWin.location=theURL;
                }
        }
//-->

</script>

</head>
<body>
<a href="http://www.test.com/office" onClick="openNavi('http://www.test.com/office'); return false;">Link 1</a><br>
<a href="http://www.test.com/sitemap" onClick="openNavi('http://www.test.com/sitemap'); return false;">Link 2</a>
</body>
</html>
0
cybernietic
Asked:
cybernietic
  • 4
  • 3
  • 2
  • +2
1 Solution
 
xabiCommented:
I tryied it in IE 5.5 and works. Sorry but don't have a Ie4 to check it out.

xabi
0
 
xabiCommented:
Anyway take a look here:

http://developer.irt.org/script/window.htm

you will find all you need to know about windows.

xabi
0
 
jbirkCommented:
That should work...  but I know you can shorten your open statement to this:
NaviWin=window.open(theURL,'popupwin',"toolbar,location,status,menubar,scrollbars,resizable,width=800,height=600");
The yes is the default, no need to specify it.

-Josh
0
Reclaim your office - Try the MB 660 headset now!

High level of background noise often makes it difficult for employees to concentrate fully on their jobs – or to communicate clearly on calls. The MB 660 headset helps you create a disruption free workspace.  

 
brigmarCommented:
cybernietic,

Just looking at the code from the off.. is the script also hosted at www.test.com ?? ( whatever your URL is...)

If not, then this is the cause of the Access Denied errors. Scripts at one host cannot read or write properties of windows hosting a document from another host.

A solution to this would be to close NaviWin, and re-open it with the new URL.

Brian
0
 
us111Commented:
hmm, good luck cybernietic with microsoft bugs :))
0
 
cybernieticAuthor Commented:
This question has a deletion request Pending
0
 
cybernieticAuthor Commented:
Thinking it's not possible to make it work in IE4
0
 
brigmarCommented:
This question no longer is pending deletion
0
 
brigmarCommented:
try replacing:

NaviWin.location = theURL;

with

NaviWin.location.replace( theURL );


Brian

0
 
brigmarCommented:
. though the problem is the

'NaviWin.focus()'

Get rid of it.

0
 
cybernieticAuthor Commented:
Was the solution for Access Denied errors
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 3
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now