2 title: Save the state in javascript tree
4 js: examples/save_state.js
9 <a href="../03_drag_and_drop/">« Example 3</a>
10 <a href="../05_load_on_demand/" class="next">Example 5 »</a>
13 <h1>Example 4 - Save the state</h1>
15 <div id="tree1" data-url="/example_data/"></div>
18 If you set the option <strong>saveState</strong> to true, then jqtree remembers the tree state after a page reload.
22 JqTree save the state into localStorage.
23 If the browser does not support localStorage, then jqTree saves the state in a cookie.
26 You must include the <a href="https://github.com/carhartl/jquery-cookie">jquery-cookie</a> plugin for cookie support.
33 <div id="tree1" data-url="/example_data/"></div>
45 Giving the <strong>saveState</strong> a string value sets the storage key. The default key is 'tree'.