Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to bring window in focus that is already open

 
Kaustubh Hande
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
Im suppose to open a new window when user clicks a link "help". Now if the user clicks on the same link even though the previously opened window has not been closed, then I am suppose to bring the same window into view. I wrote the following code but it does not work.

var winHelp // Declared as global

winHelp=window.open( "./mam/pdf/Merchant Manager Reference Guide 5.0.pdf","winHelp","width=800,height=600,status=yes,titlebar=no,menubar=no,resizable=yes,left=0,top=0,scrollbars=yes");

winHelp.focus();

Please guide

Thanks
Kaustubh
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do it with a function that looks something like this:



NOTE: FireFox logs a bunch of XULExceptions when I use the 3rd argument.
It doesn't stop the page from working.
Finding out why and how to stop them is on my todo list.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic