gwada
Status: New User - Welcome
Joined: 08 Aug 2005
Posts: 2
Back to top
Posted: Aug 8, 05, 7:39    Javascript: change window opener location from popup
Hi

i am launching a popup windows from a main html windows .
in the pop up windows i have a table with numbers , i will like when a number is double clicked to trigger the display of the page associated with that numbers on the main windows could someone give some help please

yan
techAdmin
Status: Site Admin
Joined: 26 Sep 2003
Posts: 848
Location: East Coast, West Coast? I know it's one of them.
Back to top
Posted: Aug 8, 05, 11:53    
That's pretty straighforward, the basic idea is simple, I'm not going to write your code for you, but this is roughly how it works:

Page 1 : js-o.htm
:: Code ::
<html>
<head>
</head>
<body>
<a href="#" onclick="window.open('js-c.htm','kid','resizable=no,scrollbars=no,width=250,height=148,toolbar=no');">click</a>
</body>
</html>

Page 2, the popup : js-c.htm
:: Code ::
<html>
<head>
</head>
<body>
<a href="#" onclick="window.opener.location.href='js-o2.htm';">change parent</a>
</body>
</html>

Page 3, the new parent page, js-o2.htm
:: Code ::
<html>
<head>
</head>
<body>
new page
</body>
</html>


Page 2 uses window.opener to write a new url to the location of the window opener. If you only wanted to change the content of the opener page, you'd use DHTML to change the content of an element of the page, pretty much the same syntax.

There's a pretty good discussion on this here.
gwada
Status: New User - Welcome
Joined: 08 Aug 2005
Posts: 2
Back to top
Posted: Sep 17, 05, 11:13    
Thanks.....it is working !!

yan
Display posts from previous:   

All times are GMT - 8 Hours