Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Pop Up Window - Focus and Close

Posted on 2000-02-29
11
Medium Priority
?
494 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +2
11 Comments
 
LVL 8

Expert Comment

by:xabi
ID: 2568382
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
ID: 2568386
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
ID: 2568805
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 4

Accepted Solution

by:
brigmar earned 200 total points
ID: 2568856
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
ID: 2569023
hmm, good luck cybernietic with microsoft bugs :))
0
 
LVL 1

Author Comment

by:cybernietic
ID: 2605216
This question has a deletion request Pending
0
 
LVL 1

Author Comment

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

Expert Comment

by:brigmar
ID: 2606158
This question no longer is pending deletion
0
 
LVL 4

Expert Comment

by:brigmar
ID: 2606159
try replacing:

NaviWin.location = theURL;

with

NaviWin.location.replace( theURL );


Brian

0
 
LVL 4

Expert Comment

by:brigmar
ID: 2606237
. though the problem is the

'NaviWin.focus()'

Get rid of it.

0
 
LVL 1

Author Comment

by:cybernietic
ID: 2648269
Was the solution for Access Denied errors
0

Featured Post

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Choosing a core focus or particular set of features and options can be tough. To help out, we’re going to highlight a handful of things your business needs on one of your social media pages. In other words, if one of these is missing, you should imp…
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

610 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