|
|
|||
|
|
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:
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:
Last updated: |
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|