Back button (I did it.)

Joe Crawford joe at
Wed Dec 11 17:54:57 CST 2002

On Wed, 11 Dec 2002, Menolly wrote:
> For a more complete argument against the use of JavaScript, try

Actually, that page seems to be more about not using JavaScript stupidly.
It takes skill to do properly. I agree with many of the arguments on that
page. But it doesn't throw out the baby with the bathwater, eh?

> "history(-1)" is pretty much never the right answer.  It's the lazy
> answer.  Are you positive you know where the user came from?  In a
> highly controlled web-based application with tight access controls,
> maybe you are.  So send them there directly.  If not, what's the point?
> Someone on a board I frequent posted a link to an outfit in a catalog
> the other day.  I cut'n'pasted the link to my browser.  It was just the
> photo, with no details.  I was curious about it, so I clicked the back
> link.  Which took me to the previous site I'd been looking at, not into
> the catalog as I'd hoped.  Utterly useless.

You've described a stupid use of the technology, and worse, badly

I am now thinking of a use of history that was quite useful. I designed a
GUI front end for a web application which did some very server-intensive
computation - because of the volume of data and calculations the
programmers needed a "waiting" page, which was in place until the results
were ready, it then loaded the results. The "back" button in this case
would cause lots of problems, essentially reloading a POSTed web request.
Whoops. The solution I came up with was to invoke a history.go(-2) which
took the user back to their original form data, so they could change the
parameters for the computation. Because that history.go lived on the
client side the server is saved a hit, and the responsiveness of that
"back" command worked fast.

This worked quite well, the client loved it, the application seemed faster
to the user, and it was NOT utterly useless.

So that's my example of using JavaScript in a way that was useful. The GUI
itself was also very JavaScript intensive to allow for a rich interaction
with reams of data (reams of data with multiple, hierarchical <select>

Oh, and this was done and worked great for all the users of the site -
from the CTO who used IE5.5 on Windows, to the engineers who used Netscape
4 and Mozilla 0.9 on Solaris and Linux, respectively. I also had it
working on IE5 for Mac because I knew the marketing guy would eventually
hit it. When he did, it worked great, and my company looked like stars.

Menolly, luckily, we're both right. :-) Bad JavaScript and improperly
implemented JavaScript are bad. And Good JavaScript can be quite useful.
But quite right, I don't trust many people to use JavaScript well.

Joe Crawford, web journeyman.  San Diego Calif. USA
.............||||||||||||||||| latest thought:
............||||||||||||||| san diego web folk:
...........||||||| san diego bloggers:


The posting address is: san-diego-pm-list at

List requests should be sent to: majordomo at

If you ever want to remove yourself from this mailing list,
you can send mail to <majordomo at> with the following
command in the body of your email message:

    unsubscribe san-diego-pm-list

If you ever need to get in contact with the owner of the list,
(if you have trouble unsubscribing, or have questions about the
list itself) send email to <owner-san-diego-pm-list at> .
This is the general rule for most mailing lists when you need
to contact a human.

More information about the San-Diego-pm mailing list