title: JSON and jQuery Live Search
body: <p>I've been stuck on this issue for days with my jQuery/JSON based live search I'm building for an online store. Using <a href="http://www.tipue.com/drop/" rel="nofollow">Tipue Drop</a> open source I am able to get results when using their test JSON but cannot seem to get it to read mine. I have a JSON file <a href="http://barbarostudios.com/clientpreviews/lungavita2/api/search.php" rel="nofollow">here</a> and am using the below javascript to try and read the Name and Description fields using Tipue Drop. Any advice on how I can solve this is appreciated!</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>/*
  Tipue drop 5.0.2
  Copyright (c) 2015 Tipue
  Tipue drop is released under the MIT License
  http://www.tipue.com/drop
  */
  
  
  (function($) {
  
       $.fn.tipuedrop = function(options) {
  
            var set = $.extend( {
            
                 'show'                   : 3,
                 'speed'                  : 300,
                 'newWindow'              : false,
                 'mode'                   : 'static',
                 'contentLocation'        : 'tipuedrop/tipuedrop_content.json'
            
            }, options);
            
            return this.each(function() {
            
                 var tipuedrop_in = {
                      pages: []
                 };
                 $.ajaxSetup({
                      async: false
                 });
                 
                 if (set.mode == 'json')
                 {
                      $.getJSON(set.contentLocation)
                           .done(function(json)
                           {
                                tipuedrop_in = $.extend({}, json);
                           });
                 }               
                 
                 if (set.mode == 'static')
                 {
                      tipuedrop_in = $.extend({}, tipuedrop);
                 }
  
                 $(this).keyup(function(event)
                 {
                      getTipuedrop($(this));
                 });               
                 
                 function getTipuedrop($obj)
                 {
                      if ($obj.val())
                      {
                           var c = 0;
                           for (var i = 0; i &lt; tipuedrop_in.pages.length; i++)
                           {
                                var pat = new RegExp($obj.val(), 'i');
                                if ((tipuedrop_in.pages[i].name.search(pat) != -1 || tipuedrop_in.pages[i].description.search(pat) != -1) &amp;&amp; c &lt; set.show)
                                {
                                     if (c == 0)
                                     {
                                          var out = '&lt;div class="tipue_drop_box"&gt;&lt;div id="tipue_drop_wrapper"&gt;';    
                                     }
                                     out += '&lt;a href="' + tipuedrop_in.pages[i].id + '"';
                                     if (set.newWindow)
                                     {
                                          out += ' target="_blank"';
                                     }
                                     out += '&gt;&lt;div class="tipue_drop_item"&gt;&lt;div class="tipue_drop_left"&gt;&lt;img src="' + tipuedrop_in.pages[i].id + '" class="tipue_drop_image"&gt;&lt;/div&gt;&lt;div class="tipue_drop_right"&gt;' + tipuedrop_in.pages[i].name + '&lt;/div&gt;&lt;/div&gt;&lt;/a&gt;';
                                     c++;
                                }
                           }
                           if (c != 0)
                           {
                                out += '&lt;/div&gt;&lt;/div&gt;';               
                                $('#tipue_drop_content').html(out);
                                $('#tipue_drop_content').fadeIn(set.speed);
                           }
                      }
                      else
                      {
                           $('#tipue_drop_content').fadeOut(set.speed);
                      }
                 }
                 
                 $('html').click(function()
                 {
                      $('#tipue_drop_content').fadeOut(set.speed);
                 });
            
            });
       };
       
  })(jQuery);</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script&gt;
    $(document).ready(function() {
         $('#tipue_drop_input').tipuedrop({
              'mode': 'json',
              'contentLocation': 'http://barbarostudios.com/clientpreviews/lungavita2/api/search.php'
         });
    });
  &lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>