Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

history.back() (was: Replace <center> Tag)

0 views
Skip to first unread message

Thomas 'PointedEars' Lahn

unread,
Oct 21, 2015, 5:01:36 PM10/21/15
to
Osmo Saarikumpu wrote:

> On 21.10.2015 8:52, Jukka K. Korpela wrote:
>> ... What you *should* ask is really whether the construct is useful at
>> all. It creates a pseudo-link that duplicates a basic browser
>> functionality (namely that of a browser's “Back” button or equivalent)
>> when JavaScript is enabled

True.

>> and does nothing (or maybe triggers an error) when it is not.

It never triggers an error. Never has, and never is going to, because
breaking the Web aside, that would mean that an author could determine if a
user were at the beginning of the tab’s/window’s history (privacy issue, see
below).

>> And it may mess up the browser’s history mechanism.

It cannot, as it triggers the same.

> And, if I may add, there might be no history to go back to. IOW, the
> construct is, if not ever, at least extremely rarely useful.

Apparently, the people in our User Experience (UX) department beg to differ,
based on their tracking data. A major advantage of that pseudo-link is that
the previously viewed document is not necessarily reloaded upon navigation.
Which means that navigation is faster, and there is a good chance that form
data put in is preserved (otherwise the server has to provide the data, of
course), which improves the UX, and server load can be reduced.

But: One must differentiate between a Web application and a Web site insofar
that with a Web application the user is lead through steps of a process and
in general cannot see the document containing the Back pseudo-link before
having seen the document where they would be navigating back to (that would
require a login, but the login is only made possible at the beginning of the
process).

> At the very least, before your user sees a 'go back pseudo-link', you
> should be sure that:
>
> 1) script support is present and enabled

See my other follow-up for that.

> 2) the window or tab has history

In favor of user privacy, it is only possible for authors to determine
whether the window or tab has a non-empty history, but not whether the
currently displayed resource is at the beginning of the history. Insofar
the corresponding property (window.history.length) can only avoid a few user
errors with this pseudo-link, but not all of them.

<http://www.w3.org/TR/2014/REC-html5-20141028/browsers.html#history>

(This describes current practice and is not limited to HTML5.)

X-Post & F'up2 .misc


PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f806at$ail$1$8300...@news.demon.co.uk>
0 new messages