View Full Version : Popup window link target original window?
Candrias77
09-26-2002, 01:14 PM
I have a little pop up window that displays the latest features of a website. I was wanting the normal <a href> links in this small popup window to target the original main page window.
The original window was never "created' so is not named, is it possible to name the window somehow and just target it with a simple <a target> or is there more to it?
I have seen this done with the log in window on www.domainz.net.nz but am not sure where to start.
Thanks.
Try the following
In the main page
<SCRIPT LANGUAGE="JavaScript">
<!--
function newWindow(file,window) {
msgWindow=open(file,window,'resizable=no,width=200,height=200');
if (msgWindow.opener == null) msgWindow.opener = self;
}
//-->
</SCRIPT>
<FORM>
<INPUT TYPE="button" VALUE="Open New Window" onClick="newWindow('a.html','window2')">
</FORM>
In the document loaded into the popup
<SCRIPT LANGUAGE="JavaScript">
<!--
function load(file,target) {
if (target != '')
target.window.location.href = file;
else
window.location.href = file;
}
//-->
</SCRIPT>
<A HREF="javascript:load('b.html',opener)">load document into opener</A>
adios
09-26-2002, 04:48 PM
No more to it. Name that window:
<script type="text/javascript" language="javascript">
self.name = 'Candrias77';
</script>
Then:
<a href="...." target="Candrias77">
Candrias77
09-29-2002, 12:27 PM
yep, it was as simple as you said adios
thanks
johntod02
05-12-2009, 02:32 PM
suppose if we are hyperlinking a keyword, for example Search Engine Optimisation (http://www.alkemi.co.nz), to hyper link a keyword we use html. So is it also a type of coding.
johntod02
05-13-2009, 01:54 PM
good post
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.