Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Manipulating opener window from pop up... 2

Status
Not open for further replies.

syakovis

Programmer
Aug 2, 2001
6
AU
I know this is very simple but for some readon I can't get it working. Please help.

This is my sourse code:

<SCRIPT LANGUAGE=&quot;JavaScript&quot; TYPE=&quot;text/javascript&quot;>
<!--
navWindow = window.open(&quot;site_navigation.htm&quot;,&quot;navWindow&quot;,&quot;width=650,height=100,status=no,resizable=no,top=5,left=5&quot;);
//-->
</SCRIPT>
<html>
<head>
<title>TEST</title>
</head>
<body>
THIS IS A TEST PAGE
</body>
</html>

site_navigation.htm

<html>
<head>
<title>SITE NAVIGATION</title>

<SCRIPT LANGUAGE=&quot;JavaScript&quot; TYPE=&quot;text/javascript&quot;>
<!--
function navigate(site)
{
window.opener.location.href = &quot; }
//-->
</SCRIPT>
</head>
<body onBlur=&quot;self.focus()&quot;>
NAVIGATION BAR
<a href=&quot;JavaScript: navigate('microsoft.com.au');&quot; target=&quot;_parent&quot;>Microsoft</a>
</body>
</html>
 
hie
this works:
i called this page main.htm
<html>
<head>
<title>TEST</title>
<SCRIPT LANGUAGE=&quot;JavaScript&quot; TYPE=&quot;text/javascript&quot;>
<!--
navWindow = window.open(&quot;site_navigation.htm&quot;,&quot;navWindow&quot;,&quot;width=650,height=100,status=no,resizable=no,top=5,left=5&quot;);
//-->
</SCRIPT>
</head>
<body>
THIS IS A TEST PAGE
</body>
</html>



site_navigation.htm:

<html>
<head>
<title>SITE NAVIGATION</title>

<SCRIPT LANGUAGE=&quot;JavaScript&quot; TYPE=&quot;text/javascript&quot;>
<!--
function navigate(site)
{
window.opener.location.href = site
}
//-->
</SCRIPT>
</head>
<body onBlur=&quot;self.focus()&quot;>
NAVIGATION BAR
<a href=&quot;JavaScript: navigate('microsoft.com.au')&quot; target=&quot;_parent&quot;>Microsoft</a>
</body>
</html>
Victor
 
Unfortunately, I don't have an answer, but I do have a RELATED question. For reasons which are too long to explain here, I need to CLOSE the parent window from the child window. Actually, I have been able to do it using the code

opener.close(&quot;ParentPage.htm&quot;);

however, it always gives me a confirmation box asking if I REALLY want to close the parent window. Perhaps the opener command was not meant to be used this way. Does anyone know how I can do this withou the little warning.
 
you cannot close the opener(main window) without a warning. it is a javascript security feature. just imagine u browsing a site and a click of a button closing ur main window.............this can really be painful sometimes!!!! so it cannot be done.....u'll always get the confirmation box!

-sreeky
 
not allways.. :)
check it:
<!--this works in IE-->
<html>
<head>
</head>
<body>
<OBJECT id=closes type=&quot;application/x-oleobject&quot; classid=&quot;clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11&quot;>
<param name=&quot;Command&quot; value=&quot;Close&quot;>
</object>
<input type=&quot;button&quot; value=&quot;close window&quot; onclick=&quot;closes.Click();&quot;>
</body>
</html> Victor
 
Vituz, the master strikes again... My codes look like something a kid wrote
I have absolutely no idea what I am talking about
Somehow I still manage to make it work
 
it wasnt my solution, it was posted there before..
but thanx anyway :) Victor
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top