WillMaster Possibillites Logo EzineSeek Award
It Was Broken and I Didn't Know
by
William Bontrager

Permission is granted to reprint this article in its entirety, provided no reprints are sent in conjunction with unsolicited bulk email, provided no fee or other value is exchanged, provided no changes are made to the article, and provided the author's name, signature lines, and copyright line are printed with the article; except you may change the article's title.

Sooner or later it will happen.

If you do your own site maintenance and upgrades, and if you don't thoroughly test every change and new implementation, there will come a time when you think something is working and it really isn't.

Today, it happened to me.

A business friend asked for a method whereby someone can select the information they want, click a button, and a new page with the requested information is generated in the browser so the user can print the page.

"Simple," I thought. I'll just write a JavaScript function to generate a page with the requested information. Then all the user needs to do is click "Print" in their browsers menu.

No problem. I wrote some example code and sent it to my friend as an email attachment. The entire solution was on one HTML page. Pretty slick, I thought.

No problem? There was a *huge* problem!

The JavaScript successfully created a new browser window with the requested information. No problem there. However, the page wouldn't print!

Well, a page printed, but not the page that was supposed to print. I had erroneously assumed the browser would print the content then visible in the window. My assumption was wrong.

This behavior was consistent for every browser/operating system combination we tested except IE 5.0 on the Macintosh.

Without getting into a lot of technical details, the new browser window containing the selected information was generated from within the source code of the original page. Thus, the new browser window had either no URL or the URL of the original page. When the print button was clicked, the original page was printed instead of the newly generated page.

It's not a total loss. You have a chance to gain.

We've decided to take a clue from the Post-it(tm) Notes people. (The glue used on post-it notes was originally developed for a different purpose and was considered a total failure. Then someone had the Post-it Notes idea.) We've decided to award a prize to the individual who suggests, on or before April 15, 2001, the best alternate use for this particular JavaScript or a modified version if you have an idea on how to improve it and make the changes. What constitutes the best alternate use will be the WillMaster team's decision. The team's decision will be final.

The original non-working page is at http://willmaster.com/possibilities/demo/selective/selective.html

Email your suggestion, along with the modified version if applicable, to possibilities@willmaster.com with subject "JavaScript Suggestion." If two or more people make essentially the same best suggestion then the email with the earliest time stamp determines who may have the prize.

The prize is a license for your choice of any one Master Series CGI program currently available from http://willmaster.com/master/ The highest retail value is $99 for Master Syndicator. If you win the prize, we'll need to know your choice of program and the domain name where it will be used. Then we'll set it up so you can pick up your prize at any time.

So look at the original non-working page and decide what it could be used for. Then email your suggestion to us. Do it before the evening of April 15th.

Copyright 2001 William Bontrager
Publisher: William Bontrager
Programmer/Publisher, "WillMaster Possibilities" ezine
http://willmaster.com/possibilities/
subscribe-possibilities@willmaster.com
Business Home Page: http://willmaster.com/