[Javascript] another new window question

greg at krieser.com greg at krieser.com
Wed Oct 16 08:42:40 CDT 2002


Element K just had a tip on that.  I've slightly modified their tip to allow passage of the site to the function.  I believe popupWin.focus() is what you are looking for:

function openWindow1(url) {
popupWin = window.open("http://" + url, 'win', 'menubar=yes,status=no,toolbars=no,resizable=yes,scrollbars=yes,width=800,height=600')
popupWin.focus()
}
</script>
</head>
<body>
<a href="javascript:openWindow1('www.domain1.com')">Click Me!!! - domain1.com</a><br><br>
<a href="javascript:openWindow1('www.domain2.com')">Click Me!!! - domain2.com</a>

 
The following message was sent by Cheryl Kirkpatrick <cheryl at leo.scsl.state.sc.us> on Wed, 16 Oct 2002 09:39:43 -0400.

> I have a question similar to Andrew's. I am opening a new second window
> using target and naming the new window. Other links will then open in
> the second window rather than create several new windows.
> 
> My problem -  the new second window is open, another link is clicked and
> opens in the second window. Is there a way with javascript to make the
> second window come to the foreground?
> 
> As is now, the user has to go to the toolbar and select the window. I am
> afraid that some users won't realize they need to do that.
> 
> Thank you!
> 
> --
> Cheryl Kirkpatrick
> Web Administrator/
> Information Technology Librarian
> South Carolina State Library
> http://www.state.sc.us/scsl/
> Telephone: 803.734.5831
> 
> 
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
> 



More information about the Javascript mailing list