English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Looking for javascript that will accomplish the following....there is an existing hyperlink. When the user clicks on that hyperlink, I want the new page to come up PLUS open a new browser instance (pop-up) with content in it.

2007-01-16 08:27:59 · 3 answers · asked by BAM 7 in Computers & Internet Programming & Design

3 answers

This ought to do the trick. It's the most condensed way I could think to do it.

Visit Slashdot and CNN

Get rid of the line breaks when you copy and paste the code. (Yahoo won't let me post the code any other way)

javascript: puts the link into javascript mode

window.open: opens the new window. The first argument is the URL, the rest are better described on this page http://www.devguru.com/Technologies/ecmaScript/quickref/win_open.html (or just search "javascript window.open")

location: changes the URL of the current window

Note that with browsers that support "tabs", the javascript window.open function doesn't necessarily open a new browser instance. You will probably have to use the width/height values to play with that.

2007-01-16 08:51:49 · answer #1 · answered by wi_guy 2 · 0 0

If you do not need to control the scroll bar, toolbar, size of the new window, then will do the work. But if you need more control then you need (for example).

See the sources for more details

2007-01-16 16:52:23 · answer #2 · answered by Jean M 2 · 0 0

You don't need JavaScript to do this. You can use target="_blank" in your anchor tag.

Go to CNN

2007-01-16 16:34:52 · answer #3 · answered by Doug k 3 · 0 0

fedest.com, questions and answers