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.

The extra text menu links (previously here) are being removed in the site redesign.
Browser and search engine improvements have eliminated the motivation/necessity for them.

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

Last updated:
16:21, Sat, 10.May.2014

. . .

NOTICE --- SITE  UNDERGOING REWRITE - SEE LINK BELOW FOR DETAILS

 Explanation of the rewrite: New Page Layout.
 Check out my blog: My Ephemerae
 Yes ... I want you to link to my site Please link to me
 Want to email me? I'd love to hear from you.
 I have begun tutoring in the South Houston, Texas area.

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