[Zope] Back button (off topic?)

Tino Wildenhain tino at wildenhain.de
Thu Sep 18 04:21:41 EDT 2003


Hi,

Gareth Bowker wrote:
> On Mer, 2003-09-17 at 03:48, Michael Long wrote:
> 
> 
>>I am attempting to implement a back button in my zpt page. The following
>>code works in IE but not Mozilla Firebird. When I click the button in
>>Firebird nothing happens. I have checked the options in Firebird and
>>javascipt is enabled. Does anyone know what could be causing this behavior?
>>
>><input type="button" value="Back" onClick="history.go(-1);return true;">
> 
> 
> Apart from the fact that that seems to work here (using epiphany rather
> than firebird, admittedly, but they both use the same renderer so should
> be identical), the only thing that springs to mind is that most
> javascript snippets have javascript: in front of them e.g.
> onClick="javascript:history.go(-1);return true;" . TBH though, you might
> do better to use the HTTP_REFERER header to set the return page
> explicitly as it'll then work even in browsers that have javascript
> disabled.

Sorry, but this is wrong. The javascript: schema is only
used in href attributes. The on*="" Handlers call
expressions directly. Second, the return value must
be false, not true if the action "button pressed"
should not be respected.
For firebird I'd check if the onClick handler works
in <a href ...> tags.
And last not least, you cannot trust HTTP_RERERRER. If its
there, fine.

Regards
Tino




More information about the Zope mailing list