javascript tree control + permalinks and back/forward buttons for navigation
<p>Here's the task at hand. I need to implement a fully client-side tree that will work finely with permalinks and back/forward buttons for navigation.</p>

<p>E.g. I open a page with such tree control, expand some nodes, then press back and it collapses the last expanded node, then press forward and it expands the subject node. Finally I copy the url of the page and send it to my colleague - she clicks the url and the tree gets its nodes open to reveal the same tree structure that I see on my screen.</p>

<p>I'm looking for a JavaScript tree control that would fit the following list of requirements:
<li>(Mandatory) Support for asynchronous node retrieval.</li>
<li>Possibility to hook into expand/collapse events to invoke custom logic that will serialize tree state into url anchor.</li>
<li>API for programmatic expanding/collapsing of given nodes, so that I don't have to emulate clicks when deserializing tree state upon pageload.</li></p>

<p>I've already had some experience with jsTree and jQuery treeview.</p>

<p>The problem with jsTree is that it uses &lt;a&gt; tags to render nodes, which messes up url anchors on click. After a couple of hours I've managed to migrate it to &lt;span&gt;'s, though my solution works only in Firefox. Not as good as I'd like.</p>

<p>Another thing happened when I tinkered with jQuery treeView. At first I was embarassed by its "not in active development" status, though upon a second glance it appeared to be a simple yet powerful widget. The async demo looked excellent so I tried to reproduce it at my PC and with my data. But then I faced a weird bug - when my JSON service returned lazy nodes (i.e. ones that had <code>hasChildren</code> set to <code>true</code>), the treeview immediately expanded those and rendered the "loading" gif, though without loading anything. I tried to debug this glitch, but I'm really not that smart to understand how all those callbacks and aspects interact with each other. At least not within the time window I had.</p>
