title: twitter bootstrap typeahead ajax example
body: <p>I'm trying to find a working example of the <a href="http://twitter.github.com/bootstrap/javascript.html#typeahead">twitter bootstrap typeahead</a> element that will make an ajax call to populate it's dropdown. </p>
  
  <p>I have an existing working jquery autocomplete example which defines the ajax url to and how to process the reply</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  //&lt;![CDATA[
  $(document).ready(function() {
      var options = { minChars:3, max:20 };
      $("#runnerquery").autocomplete('./index/runnerfilter/format/html',options).result(
              function(event, data, formatted)
                  {
                      window.location = "./runner/index/id/"+data[1];
                  }
              );
         ..
  </code></pre>
  
  <p>What do i need change to convert this to the typeahead example? </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  //&lt;![CDATA[
  $(document).ready(function() {
      var options = { source:'/index/runnerfilter/format/html', items:5 };
      $("#runnerquery").typeahead(options).result(
              function(event, data, formatted)
                  {
                      window.location = "./runner/index/id/"+data[1];
                  }
              );
         ..
  </code></pre>
  
  <p>I'm going to wait for the '<a href="https://github.com/twitter/bootstrap/issues/1336">Add remote sources support for typeahead</a>' issue to be resolved.</p>