title: jQuery mobile autocomplete is not updating itself
body: <p>I'm new to jQuery and jQuery mobile.</p>
  
  <p>I'm trying to get an autocomplete field working. What I have so far is pretty much ripped right from the demo at <a href="http://demos.jquerymobile.com/1.4.5/listview-autocomplete-remote/" rel="nofollow">http://demos.jquerymobile.com/1.4.5/listview-autocomplete-remote/</a></p>
  
  <pre><code>$( document ).on( "pagecreate", "#foo", function() {
  $( "#autocomplete" ).on( "filterablebeforefilter", function ( e, data ) {
      var $ul = $( this ),
          $input = $( data.input ),
          value = $input.val(),
          html = "";
      $ul.html( "" );
      if ( value &amp;&amp; value.length &gt; 2 ) {
          $ul.html( "&lt;li&gt;&lt;div class=\'ui-loader\'&gt;&lt;span class=\'ui-icon ui-icon-loading\'&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;" );
          $ul.listview( "refresh" );
          $.ajax({
              url: "/cgi/perl_script.pl",
              data: \'search=\' + value,
              dataType: "json",
              traditional: true
          })
          .then( function ( response ) {
              $.each( response, function ( i, val ) {
                  alert(JSON.stringify(val));
                  html += "&lt;li&gt;Just a test&lt;/li&gt;";
              });
              $ul.html( html );
              $ul.listview( "refresh" );
              $ul.trigger( "updatelayout");
          });
      }
  });
  });
  </code></pre>
  
  <p>I have confirmed that json data is getting returned with the js alert. That's all working perferctly. If my perl script returns 3 json records, I get three alerts with the stringified JSON.</p>
  
  <p>However, the records never get displayed by the widget even if I use a the simple "Just a test" string as shown here in my code as I try to debug the problem.</p>
  
  <p>Here is the relevant html code:</p>
  
  <pre><code>  &lt;div role="main" class="ui-content"&gt;
      &lt;form class="ui-filterable"&gt;
        &lt;input id="autocomplete-input" data-type="search" placeholder="Last name"&gt;
      &lt;/form&gt;
    &lt;ul id="autocomplete" data-role="listview" data-inset="true" data-filter="true" data-input="#autocomplete-input"&gt;&lt;/ul&gt;
  </code></pre>