title: How to make json ajax call in jsTree
body: <p>I want to make ajax call to get data for <code>results</code> nodes. In my sample code <a href="http://jsfiddle.net/radek/G789k/" rel="noreferrer">(see here)</a> the ajax call is made but the server doesn't return any thing (tested using firebug) But if I use the same url in a web browser I can save the json file.</p>
  
  <p>My questions are:</p>
  
  <ul>
  <li>how to make the ajax call to work so the return values are displayed in jsTree? It works nicely <a href="http://www.jstree.com/documentation/json_data#" rel="noreferrer">here</a> - search for <code>Using both the data &amp; ajax config options</code></li>
  <li>how to pass the ajax call <strong>parameters</strong> 
  
  <ul>
  <li>one would be the parent/parent name ( <strong>basics</strong> for the first results node )</li>
  <li>second one would be the parent node's name ( <strong>login</strong> for the first results node)</li>
  </ul></li>
  </ul>
  
  <p>See my code below or use the <a href="http://jsfiddle.net/radek/G789k/" rel="noreferrer">fiddle</a></p>
  
  <pre><code>&lt;html&gt;
    &lt;head&gt;
      &lt;title&gt;jsTree &amp; ajax&lt;/title&gt;
  
  &lt;script type="text/javascript" src="http://static.jstree.com/v.1.0pre/jquery.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="http://static.jstree.com/v.1.0pre/_docs/syntax/!script.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="http://static.jstree.com/v.1.0pre/jquery.cookie.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="http://static.jstree.com/v.1.0pre/jquery.hotkeys.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="http://static.jstree.com/v.1.0pre/jquery.jstree.js"&gt;&lt;/script&gt;
  
      &lt;script type='text/javascript'&gt;
          data = [
                      {
                          "data" : "Basics",
                          "state" : "closed",
                                              "children" : [ {
                                                                  "data" : "login",
                                                                      "state" : "closed",
                                                                      "children" : [ "login", {"data" : "results", "state" : "closed"} ]
                                                                      }   , 
                  {
                  "data" : "Basics",
                      "state" : "closed",
                      "children" : [ "login", "something",{"data" : "results", "state" : "closed"} ]
                      }    ]
                      },
                      {
                          "data" : "All",
                          "state" : "closed",
                  "children" : [ {
                  "data" : "AddCustomer",
                      "state" : "closed",
                      "children" : [ "login","Add", {"data" : "results", "state" : "closed"} ]
                      }   ]
                      }
                  ]
  $(function () {
          $("#jstree").jstree({
              "json_data" : {
                  "data" : data ,
                  "ajax" : { "url" : "http://www.jstree.com/static/v.1.0pre/_docs/_json_data.json" }
              },
              "plugins" : [ "themes", "json_data" ]
          });
      });
      &lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
  &lt;div id="jstree"&gt;&lt;/div&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <h1>Update 1</h1>
  
  <p>Even I copy the sample code from jstree.com into <a href="http://jsfiddle.net/radek/G789k/1/" rel="noreferrer">jsfiddle</a> it won't work. I guess I am missing something somewhere.... </p>