.html, how do I...?

J

Joe M

When I'm browsing a web page and there's a link to click on, sometimes it
starts in the same window, sometimes it starts a new window. Sometimes if I
right click on the link I can select to start in a new window or not,
sometimes that option is not available. What controls this? Using just
plain .html code with no code generation tools, how can specify all of these
options (automatically start in a new window, automatically start in the
same window, give the option for either, not give the option for either)?

Thanks!

Joe (joemagiera at ameritech dot net)
(e-mail address removed)
 
M

mbstevens

When I'm browsing a web page and there's a link to click on, sometimes it
starts in the same window, sometimes it starts a new window. Sometimes if I
right click on the link I can select to start in a new window or not,
sometimes that option is not available. What controls this? Using just
plain .html code with no code generation tools, how can specify all of these
options (automatically start in a new window, automatically start in the
same window, give the option for either, not give the option for either)?

target="_blank" inside the anchor opens a new window.
But don't do it -- it breaks the visitor's back button and has
accessibility issues.

JavaScript can also open a new window. That is a bad idea, too.

Just use plain anchors and let the visitor set her own browser to do
whatever *she* wants. She'll thank you for not interfering.
 
E

Ed Seedhouse

When I'm browsing a web page and there's a link to click on, sometimes it
starts in the same window, sometimes it starts a new window. Sometimes if I
right click on the link I can select to start in a new window or not,
sometimes that option is not available. What controls this?

What should control it is the browser's desire. Web pages that cause
new browser windows to pop up don't get visited much because they
violates the user's expectation. Often people have popup blockers added
to their browsers just to prevent this kind of thing.

The "target" attribute was removed from the strict DTD's so people would
stop doing this.

If you really want to drive people away from your page, however, you can
still do it and a google search will allow you to find out how.
 
J

Jukka K. Korpela

mbstevens said:
target="_blank" inside the anchor opens a new window.
But don't do it -- it breaks the visitor's back button and has
accessibility issues.

JavaScript can also open a new window. That is a bad idea, too.

For completeness, I think it needs to add that such methods _can_ be
overridden by browsers or users, so they cannot (thank &Deity;) _force_
anything. JavaScript can be disabled. Opening of new windows can be
prevented separately. Moreover, a browser may allow a user override (e.g.,
right click on the link and select "Open in a new pane").

The JavaScript way is particularly bad when implemented in the wrong way
(with no fallback for non-JavaScript browsing), as it usually is.
Just use plain anchors and let the visitor set her own browser to do
whatever *she* wants.

When plain links are used, the visitor can also decide on the opening mode
on case by case basis. This typically means just clicking on the link to
open it in the current window and right-clicking it to select some other
way, such as opening in a new window, or in a new pane, or saving the linked
page on local disk. It's not that much about browser _settings_ as about the
way one _uses_ the browser.
 
N

Nije Nego

When I'm browsing a web page and there's a link to click on, sometimes it
starts in the same window, sometimes it starts a new window. Sometimes if I
right click on the link I can select to start in a new window or not,
sometimes that option is not available. What controls this? Using just
plain .html code with no code generation tools, how can specify all of these
options (automatically start in a new window, automatically start in the
same window, give the option for either, not give the option for either)?

Thanks!

Use better web browser, Firefox ( http://www.mozilla.com/firefox/ ) will
allow you to take control.
 

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

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top