title: jQuery Fancy Tree with Local Array Data
body: <p>I am trying to implement jQuery FancyTree <a href="http://wwwendt.de/tech/fancytree/demo/" rel="nofollow">http://wwwendt.de/tech/fancytree/demo/</a> with local array data</p>
  
  <p>Referred from <a href="https://code.google.com/p/fancytree/" rel="nofollow">https://code.google.com/p/fancytree/</a></p>
  
  <p><strong>This is the code. But it is not working, No Script Error.But Tree is empty!!!</strong></p>
  
  <blockquote>
    <p>Even i copied the jQuery, UI versions of the file they using in a demo
    site. Still nothing works</p>
  </blockquote>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;script src="jquery.js" type="text/javascript"&gt;&lt;/script&gt;
      &lt;script src="jquery-ui.custom.js" type="text/javascript"&gt;&lt;/script&gt;
      &lt;link href="ui.fancytree.css" rel="stylesheet" type="text/css" /&gt;
      &lt;script src="jquery.fancytree.js" type="text/javascript"&gt;&lt;/script&gt;
      &lt;script type="text/javascript"&gt;
          $(function () {
              $("#tree").fancytree({
                  onActivate: function (node) {
                      // A DynaTreeNode object is passed to the activation handler
  
                      // Note: we also get this event, if persistence is on, and the 
                       //  age is reloaded.
                      alert("You activated " + node.data.title);
                  },
  
                  children: [ // Pass an array of nodes.
                  {title: "Item 1" },
                  { title: "Folder 2", isFolder: true,
                      children: [
                          { title: "Sub-item 2.1" },
                          { title: "Sub-item 2.2" }
                      ]
                  },
                  { title: "Item 3" }
              ]
              });
          });
  
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div id="tree"&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>