We help IT Professionals succeed at work.

re-use same child window in multiple hyperlinks

volking
volking asked
on
345 Views
Last Modified: 2010-04-09
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.
Comment
Watch Question

Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
James RodgersWeb Applications Developer
CERTIFIED EXPERT

Commented:
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>
James RodgersWeb Applications Developer
CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
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"

Author

Commented:
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>
James RodgersWeb Applications Developer
CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
James RodgersWeb Applications Developer
CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
James RodgersWeb Applications Developer
CERTIFIED EXPERT

Commented:
glad i could help

thanks for the points

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.