Opening links in new window

B

BernieH

I'm trying to get the links in the following dropdown list to open up in a
new window when the Go button is pressed. At the moment they open up in the
same window. Can anybody help?

<form name="quicklinks">
<select name="links">
<option value=" ">--Select--</option>
<option value="examples.htm">Examples</option>
<option value="main.htm">Main</option>
<option value="http://www.google.com">Test</option>
</select>
<input type="button" name="go" value="Go!"
onClick="window.location=document.quicklinks.links.options[document.quicklinks.links.selectedIndex].value">
</form>

TIA

BernieH
 
M

Mark Parnell

Previously in alt.html said:
I'm trying to get the links in the following dropdown list to open up in a
new window when the Go button is pressed. At the moment they open up in the
same window. Can anybody help?

Check the documentation for your browser.

What's that? Oh, you want it to do that in *my* browser? Tough. It's my
browser, not yours.
 
A

Adrienne

I'm trying to get the links in the following dropdown list to open up
in a new window when the Go button is pressed. At the moment they open
up in the same window. Can anybody help?

<form name="quicklinks">
<select name="links">
<option value=" ">--Select--</option>
<option value="examples.htm">Examples</option>
<option value="main.htm">Main</option>
<option value="http://www.google.com">Test</option> </select> <input
type="button" name="go" value="Go!"
onClick="window.location=document.quicklinks.links.options[document.quic
k links.links.selectedIndex].value"> </form>

TIA

There are a lot of things wrong with what you want to do.

1. If a user has javascript disabled, or does not have javascript, they
will not be able to navigate. That would include search engine bots, like
Google.

2. Opening new windows is a Bad Idea. It breaks the Back Button and can
confuse visitors, sometimes enough they never come back.

3. Using this sort of widget for navigation is also bad because the user
has to scroll to see the choices. A nicely styled navigation menu using UL
and LI elements is a much better choice.
 
L

Leonard Blaisdell

"BernieH" said:
I'm trying to get the links in the following dropdown list to open up in a
new window when the Go button is pressed.

Don't. As a user, I hate popups with a passion. Perhaps, I'm in the
minority with that attitude but I doubt it. Didn't expect it. Don't want
it. Don't like it. Extraneous crap on my screen. Can't use the back
button. Hate your site.

leo
 
B

BernieH

Thanks for all input so far. The site is an intranet which uses frames.
Sites within the home domain will open up within the frame; but for outside
sites we really need to open a new window; not popups. JavaScript will not
be a problem since JavaScript is enabled by default on all computers which
will use the intranet.

Hoping this clarifies things :)

BernieH
 
R

rf

BernieH wrote
really need to open a new window; not popups

A popup *is* a new window.

However, if this is not for the internet at large (a fact you *should* have
mentioned in your op) then window.open is the function you are looking for.

Google for "window.open". The very first hit is microsofts documentation on
this function. There are even examples.
 
H

Henry

BernieH said:
Thanks for all input so far. The site is an intranet which uses frames.
Sites within the home domain will open up within the frame; but for outside
sites we really need to open a new window; not popups. JavaScript will not
be a problem since JavaScript is enabled by default on all computers which
will use the intranet.

Hoping this clarifies things :)


Try...

<p><a target="_blank" href="top.htm">link</a></p>


Despite some objections here, many people love it! Including myself.

You don't have to press back button and use a bandwidth.

Because you see both arrows gray, you know that is a new window and to
go back to your page, user have to simply close that page and that way
is quicker than reload the page.

Of course users can press RMB on the link and select -"Open the link in
new window" but... how many users are that smart?

;)
 
L

Leif K-Brooks

Henry said:
<p><a target="_blank" href="top.htm">link</a></p>

Despite some objections here, many people love it! Including myself.

Great, so middle-click the link and get what you love. People who have
different preferences can left-click the link; no one forces anything on
anyone, everyone wins.
You don't have to press back button and use a bandwidth.

Many browsers will use their cache to load pages after a back-button
click, so no extra bandwidth will be used.
Because you see both arrows gray, you know that is a new window and to
go back to your page, user have to simply close that page and that way
is quicker than reload the page.

Of course users can press RMB on the link and select -"Open the link in
new window" but... how many users are that smart?

You really expect users who don't know how to open a new window on their
own to know how to close one? My mother -- better at using a computer
than most, by the way -- has had to have me explain why her back button
has broken many, many times.
 
D

DU

BernieH said:
Thanks for all input so far. The site is an intranet which uses frames.

It would have been nice to say all this in your initial post.
Sites within the home domain will open up within the frame;

then use the target attribute.

but for outside
sites we really need to open a new window; not popups.

A popup is a new window.

JavaScript will not
be a problem since JavaScript is enabled by default on all computers which
will use the intranet.

The arguments of other posters still are valid ones.
Hoping this clarifies things :)

BernieH

Yes but you could clarify the contextual reading of your post by
avoiding top-posting.

DU
--
The site said to use Internet Explorer 5 or better... so I switched to
Mozilla 1.7.3 :)
I'm trying to get the links in the following dropdown list to open up in a
new window when the Go button is pressed. At the moment they open up in
the same window. Can anybody help?

<form name="quicklinks">
<select name="links">
<option value=" ">--Select--</option>
<option value="examples.htm">Examples</option>
<option value="main.htm">Main</option>
<option value="http://www.google.com">Test</option>
</select>
<input type="button" name="go" value="Go!"
onClick="window.location=document.quicklinks.links.options[document.quicklinks.links.selectedIndex].value">
</form>

TIA

BernieH
 
K

Karl Core

BernieH said:
I'm trying to get the links in the following dropdown list to open up in a
new window when the Go button is pressed. At the moment they open up in
the same window. Can anybody help?

<form name="quicklinks">
<select name="links">
<option value=" ">--Select--</option>
<option value="examples.htm">Examples</option>
<option value="main.htm">Main</option>
<option value="http://www.google.com">Test</option>
</select>
<input type="button" name="go" value="Go!"
onClick="window.location=document.quicklinks.links.options[document.quicklinks.links.selectedIndex].value">
</form>

TIA

BernieH

Dropdowns suck
Opening shit in a new window sucks
http://karlcore.com/articles/article.php?id=25
 
H

Henry

Karl said:
Dropdowns suck
Opening shit in a new window sucks
http://karlcore.com/articles/article.php?id=25


I have to admit that you are absolutely right Karl.
It's unbelievable how many people could have problem with new window.
Sometimes I think that is doesn't matter how easy could be a new task to
learn, the most people will still refuse to learn it anyway.

Good one... treat users as total idiots and provide for them a
functionality they will be able understand.

But that means... if most people will not change to FF or Opera, how
long we will have to endure IE and Windoze??????


:(
 
E

erikd

Try...

<p><a target="_blank" href="top.htm">link</a></p>

The key portion of the above is the target="_blank" as stated above.
I'm in the same position as you. I have frames and for some windows I
want to open a new window, while in others I want to open it in the
same window.
 
M

Mark Parnell

I'm in the same position as you. I have frames and for some windows I

http://www.htmlhelp.com/design/frames/whatswrong.html
http://html-faq.com/htmlframes/?framesareevil
http://dorward.me.uk/www/frames/
http://www.google.com/webmasters/2.html (see under "Your page uses
frames")
http://www.markparnell.com.au/articles/frames.php
want to open a new window, while in others I want to open it in the
same window.

Sigh. It's not about what *you* want. It's about what your *users* want.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top