[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-smalltalk] [Iliad] Bookmarking AJAX actions and fixing the back/fo
[Help-smalltalk] [Iliad] Bookmarking AJAX actions and fixing the back/forward buttons
Mon, 17 Aug 2009 11:19:15 +0200
There is a new feature in recent versions of Iliad which allows you to
bookmark your AJAX app, using the hash (fragment) of the url - the hash
is the part after the #.
How to use it:
There are two steps to do it.
STEP ONE: Each anchor action can be associated with a hash parameter
For instance, in a blog app, you could write something like this:
action: [self showComments]
the action will be evaluated normally, but in addition the hash will be
added to the url.
STEP TWO: The next step is to retreive the state from the url, to update
state from normal requests too (when you give a link to someone or
refresh the page for example).
There is now a new route dedicated to the hash path, available in
You can use it like every other route:
self hashRoute next = 'showComments' ifTrue: [self showComments].
This way, bookmarking AJAX state becomes easy, and you still think of
your control flow in term of actions.
Also, it will add entries to the history; so the back button will work
for your ajax apps :)
Iliad did before, making normal requests, and just not using the hash.
There is one drawback: the back button doesn't work for IE < 8 yet. I
still have to add a hack to iliad.js, but this will work too eventually.
Also, please note that this is very young code and may change in the
Cheers and sorry for the long post,
Description: Ceci est une partie de message numériquement signée
|[Prev in Thread]
||[Next in Thread]|
- [Help-smalltalk] [Iliad] Bookmarking AJAX actions and fixing the back/forward buttons,
Nicolas Petton <=