James S. Huggins' Refrigerator Door: Click here to go to my Home Page. javascript new window, javascript pop window, target, html new window, qwerty
.
Hammer and Nail --- Why Use JavaScript
Why Use JavaScript?

As I surf the net, more and more I encounter pages that insist on using JavaScript. Some of the uses are great, even necessary.

But one use in particular drives me nuts: using JavaScript to launch a new window to show me a web page.

I wrote this page to discuss that particular practice.


Why Use JavaScript

As I surf the net, I encounter web pages using JavaScript to launch a new window to show me a web page.

There is absolutely no reason to do this.

Well, that is a bit of an overstatement. There are several reasons a ringmaster might list. These include:

  1. It is the only way I know.
     
  2. I want to deny control the surfer.
     
  3. We've always done it that way.
     
  4. I've got a brand new silver hammer and everything looks like a nail.

The problem, of course, is that I happen to disagree with all of them.

It Is the Only Way I Know

Wrong. Specifying target="_blank" as part of a standard HTML link will open a new browser window. Of course it will also provide the surfer with access to all the standard browser controls. But why is that a problem?

I Want to Deny Control to the Surfer

I've had designers tell me that they didn't want the surfer to be able to control the window.

Why not? I mean, this is the internet.

And I've had designers tell me that they didn't want to reveal the URL of the page because they didn't want anyone to link directly to the page.

Again why not?

Discouraging other sites from linking directly to your pages of interest just discourages other sites from linking to your site at all.

Encourage visitors to link to any page they want. Then design your site so that no matter what page a person visits, that person is encouraged to visit the rest of your site and given the navigation tools to make that possible.

We've Always Done It That Way

Do I really need to comment on this one?

I've Got a Brand New Silver Hammer and Everything Looks Like a Nail

My investigation shows that this may be the most pervasive reason.

Rather than using JavaScript to launch a new window for any good reason, the designer/coder does it because he/she can. Perhaps they just found out how. Perhaps they saw another site and thought it was cool. Perhaps they are trying to keep up with the Joneses.

But doing it because you can is not a good reason.

If a standard link with a specification to open a new window ( target="_blank" ) does the job, why not use it? It works with browsers that do not support JavaScript. (And many of the browsers used by the sight impaired do not support JavaScript.) It keeps the surfer in control of the experience. It works.

Unless there is a very good reason not to use a standard link, you should.

This page created:
before
Fri, 25.Oct.2002

Last updated:
18:17, Thu, 27.Mar.2008

. . .
Snippets: read about my free email newsletter and subscribe on this page.
This site follows the Core Principles of Ezine Privacy from EzinePrivacy.org - Defending the privacy of ezine subscribers
Creative Commons License button - Except as otherwise noted, original content of this website is licensed under a Creative Commons License.
Web hosting by 1and1.com - check the incredible prices and options Content management and SEO by The Eclectic Power Company - EclecticPower.com

w Check out my free ezine newsletter: Snippets.
w Yes ... I want you to link to my site. Please link to me.
w Want to contact me? Email me. I'd love to hear from you.

» Copyright © 1997-2008 James S. Huggins. All rights perversed.
» Original content licensed under a Creative Commons License.
» Web hosting provided by 1and1.com.
» Content management & SEO by The Eclectic Power Company.
» Concerned about privacy? Read my Privacy Statement.
» Trouble sleeping? Try the legal page.Honey, Honey, I've Got Honey! Here is my EMT Page.

. . .
javascript new window, javascript pop window, target, html new window, qwerty . . . javascript new window, javascript pop window, target, html new window, qwerty