RE: [webwatch] How to return from longdesc?

> An obvious solution is to use JavaScript

when you have a hammer, everything looks like a nail...but
here are my (unsorted, as it's quite early and I haven't
had my coffee yet) thoughts: provided that you have access
to some kind of server-side language, you could

a) provide a "back" link which is dynamically written based
on the the HTTP_REFERER. However, this method is not
100% reliable, as software such as Norton Firewall purpousely
clear the referer (to prevent sites from tracking a user's
steps around a site, which can be done quite easily matching up
individual page hits and http_referer entries in the server
log files);

b) dynamically add the current page's url as a GET parameter
to the longdesc link, and on the longdesc page dynamically create
a link back to this parameter.

Simple code snippet for b) (using PHP)

<img src="stats.jpg" width="500" height="300"
alt="site access diagram" longdesc="/pages/longdesc/stats.php?
referer=<?php echo $_SERVER['REQUEST_URI'];?>">

and on the longdesc page

<?php if (!empty($_GET['referer'])) {
echo '<a href="'.$_GET['referer'].'">return to previous page</a>';
} ?>

Well, looking at this again, a further thought would be that once
you start doing this kind of stuff dynamically, you may as well
take it one step further: send all longdescs to the same url, passing
along the current page *and* some some sort of ID for the longdesc,
which is then fetched from a database/XML repository/filesystem/etc.

Or something along those lines anyway.
My GBP0.02 on this...

Patrick
________________________________
Patrick H. Lauke
Webmaster / University of Salford
http://www.salford.ac.uk

Received on Monday, 18 August 2003 05:02:44 UTC