Link to home
Create AccountLog in
Avatar of volking
volking

asked on

re-use same child window in multiple hyperlinks

I'm writing a HELP system. I want hyperlinks on my website to open individual help pages. But, I do NOT want to "Open New Window" and "Open New Window" and "Open New Window" ... arrrrgh I personally dislike all those stupid windows!

How do I tell a dozen different hyperlinks to REUSE the exact same "child" window which may (or may not) have already been opened by an earlier hyperlink?

so I get one "new" window used over-and-over again.
ASKER CERTIFIED SOLUTION
Avatar of frin
frin
Flag of Slovenia image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Avatar of James Rodgers
both above will work, however once teh window is open and the user returns to teh parent, when a new link is clicked the child window will remain in the background
try adding this to the second option

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
      <title>Untitled</title>
<script language="JavaScript" type="text/javascript">
var newWin='';
function setWindow(url){
      if(!newWin || newWin.closed){
            newWin=window.open(url,'','true');      
      }
      newWin.focus();

}


</script>
</head>

<body>
<a href="#" onclick="setWindow('somePage.html');">Help</a>



</body>
</html>
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Avatar of volking
volking

ASKER

So these lines would open different help pages but all into the exact SAME browser window? Right?

<a href="login.htm" target="helpWindow">AboutLogin</a>
<a href="signup.aspx" target="helpWindow">SignupHelp</a>
<a href="contact.html" target="helpWindow">TalkBack?</a>

So the key is ..... target="WhatEverName"
Avatar of volking

ASKER

The javascript option is good too, but can bookmarks be passed in the urls?

<a href="#" onclick="setWindow('SignupHelp.htm#bookmarkAAA');">Help</a>
<a href="#" onclick="setWindow('SignupHelp.htm#bookmarkBBB');">Help</a>
<a href="#" onclick="setWindow('SignupHelp.htm#bookmarkCCC');">Help</a>
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
glad i could help

thanks for the points