title: Using a jQuery Plugin ddSlick Dropdown - How do I dynamically populate JSON data?
body: <p>I have what is likely a pretty simple question.  I have a jQuery plugin for a fancy dropdown box.</p>
  
  <p>The plugin is called with:</p>
  
  <pre><code>$('#demoBasic').ddslick({
      data: ddData,
      width: 300,
      imagePosition: "left",
      selectText: "Select your favorite social network",
      onSelected: function (data) {
          console.log(data);
      }
  });
  </code></pre>
  
  <p>The JSON data to populate the dropdown is:</p>
  
  <pre><code>var ddData = [
  {
      text: "Facebook",
      value: 1,
      selected: false,
      description: "Description with Facebook",
      imageSrc: "http://dl.dropbox.com/u/40036711/Images/facebook-icon-32.png"
  },
  {
      text: "Twitter",
      value: 2,
      selected: false,
      description: "Description with Twitter",
      imageSrc: "http://dl.dropbox.com/u/40036711/Images/twitter-icon-32.png"
  }
  ];
  </code></pre>
  
  <p>So what I want to do is populate that JSON data dynmically.   I can write the PHP code to do my search and return the JSON, but how would I do that programmtically so it would load it based on a search?</p>
  
  <p>I had an idea of just loading it up through an ajax post but and then returning the result in a div.... would that work?</p>
  
  <p>Like:</p>
  
  <pre><code>submitHandler: function() {
      $.post('lookup.php', $("#lookup").serialize(), function(data) {
          $('#result').html(data);
      });
  },
  </code></pre>
  
  <p>Can I return a jQuery script thorugh that type of call?</p>