cybernietic
asked on
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)||(NaviW in.closed) )
{
NaviWin=window.open(theURL ,'popupwin ',"toolbar =yes,locat ion=yes,st atus=yes,m enubar=yes ,scrollbar s=yes,resi zable=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>
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)||(NaviW
{
NaviWin=window.open(theURL
}
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>
Anyway take a look here:
http://developer.irt.org/script/window.htm
you will find all you need to know about windows.
xabi
http://developer.irt.org/script/window.htm
you will find all you need to know about windows.
xabi
That should work... but I know you can shorten your open statement to this:
NaviWin=window.open(theURL ,'popupwin ',"toolbar ,location, status,men ubar,scrol lbars,resi zable,widt h=800,heig ht=600");
The yes is the default, no need to specify it.
-Josh
NaviWin=window.open(theURL
The yes is the default, no need to specify it.
-Josh
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
hmm, good luck cybernietic with microsoft bugs :))
ASKER
This question has a deletion request Pending
ASKER
Thinking it's not possible to make it work in IE4
This question no longer is pending deletion
try replacing:
NaviWin.location = theURL;
with
NaviWin.location.replace( theURL );
Brian
NaviWin.location = theURL;
with
NaviWin.location.replace( theURL );
Brian
. though the problem is the
'NaviWin.focus()'
Get rid of it.
'NaviWin.focus()'
Get rid of it.
ASKER
Was the solution for Access Denied errors
xabi