Solved

Pop Up Window - Focus and Close

Posted on 2000-02-29
11
468 Views
Last Modified: 2013-11-28
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
Comment
Question by:cybernietic
  • 4
  • 3
  • 2
  • +2
11 Comments
 
LVL 8

Expert Comment

by:xabi
Comment Utility
I tryied it in IE 5.5 and works. Sorry but don't have a Ie4 to check it out.

xabi
0
 
LVL 8

Expert Comment

by:xabi
Comment Utility
Anyway take a look here:

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

you will find all you need to know about windows.

xabi
0
 
LVL 8

Expert Comment

by:jbirk
Comment Utility
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
 
LVL 4

Accepted Solution

by:
brigmar earned 100 total points
Comment Utility
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
 
LVL 8

Expert Comment

by:us111
Comment Utility
hmm, good luck cybernietic with microsoft bugs :))
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 1

Author Comment

by:cybernietic
Comment Utility
This question has a deletion request Pending
0
 
LVL 1

Author Comment

by:cybernietic
Comment Utility
Thinking it's not possible to make it work in IE4
0
 
LVL 4

Expert Comment

by:brigmar
Comment Utility
This question no longer is pending deletion
0
 
LVL 4

Expert Comment

by:brigmar
Comment Utility
try replacing:

NaviWin.location = theURL;

with

NaviWin.location.replace( theURL );


Brian

0
 
LVL 4

Expert Comment

by:brigmar
Comment Utility
. though the problem is the

'NaviWin.focus()'

Get rid of it.

0
 
LVL 1

Author Comment

by:cybernietic
Comment Utility
Was the solution for Access Denied errors
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

With a software solution, you always get to control email signatures and have the final say on the design - not an unrelated department or the uninterested end user.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now