[Seaside] jQuery history plugin

Jan van de Sandt jvdsandt at gmail.com
Sun Jun 27 14:09:21 UTC 2010


Hello list,

I am trying to add support for the jQuery history plugin (
http://github.com/tkyk/jquery-history-plugin) to Seaside. The API of the
plugin looks pretty simple but I don't know how to integrate it with the
Seaside jQuery support.

In the onLoad on ready function you should register a callback function
using $.history.init(callback). This callback function gets called with a
url hash value as an argument. This function should get the new content from
the server using an AJAX request.

For the AJAX links on your page that should be bookmarkable and should
support the backbutton you must use the $.history.load('#some_anchor')
function.

In Seaside this should look something like:

    html anchor
        onClick: (html jQuery history load: '#link1');
        with: 'Link 1'.

And the init function can be called as part of the onLoad scripts:

    html document addLoadScript:
        (html jQuery history init: [ :anchor | self updateUsingAnchor:
anchor ])

This second fragment is probably totally wrong. The update method needs
something to render on. Can anybody push me in the right direction?

Jan.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20100627/661e6c5c/attachment.htm


More information about the seaside mailing list