title: pass dynamic json to ddslick js plugin
body: <p>someone knows a way to pass a dynamically generated json to a js plugin</p>
  
  <p>i'm making a dynamic dropdown list using the DDslick js plugin </p>
  
  <p><a href="http://designwithpc.com/Plugins/ddSlick#demo" rel="nofollow">http://designwithpc.com/Plugins/ddSlick#demo</a></p>
  
  <p>the item in the DDslick are hardcoded in json format like this</p>
  
  <pre><code>    var ddData = [
       {
      text: "Facebook",
      value: 1,
      selected: false,
      description: "Description with Facebook",
      imageSrc: "xxxxx"
      },
      {
      text: "Twitter",
      value: 2,
      selected: false,
      description: "Description with Twitter",
      imageSrc: "xxxxx"
       }      
      ];
  </code></pre>
  
  <p>this dropdown list must be dynamic, so for now i'm making a dummy json with these values</p>
  
  <pre><code>            JSONObject json = new JSONObject();
              JSONObject json2 = new JSONObject();
              try {
                  json.put("text", "xxxxx");
                  json.put("value", "xxxx");
                  json.put("description", "xxxx-xxxx-xxxx");
                  json.put("imageSrc", "xxxxx");
                  json2.put("text", "aaaa");
                  json2.put("value", "aaaa");
                  json2.put("description", "aaaa-aaaa-aaaa");
                  json2.put("imageSrc", "aaaa");
              } catch (JSONException e) {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
              }
               string output = json.toString()+","+json2.toString();
  </code></pre>
  
  <p>and giving the output to the plugin like this on the jsp, but none of this works, the dropdownlist is not visible</p>
  
  <pre><code>             var ddData = eval("${output}");
               var ddData = "${output}";
               var ddData = ["${output}"];
  </code></pre>
  
  <p>and if i hardcode the same string output in the jsp, it works</p>
  
  <pre><code>var ddData = [
      {"text":"xxx","imageSrc":"xxxx","description":"xxxx-xxxx-xxx","value":"xx"},
      {"text":"aaaa","imageSrc":"aaaa","description":"aaaa-aaaa-aaaa","value":"aaaa"}
  ];
  </code></pre>