--- title: Search | Compass Documentation crumb: Search body_id: search --- - content_for(:javascripts) do %script(type="text/javascript" src="/docs/javascripts/search-data.js") :javascript $(function(){ $('input').keypress(function(){ search(this.value, displayResults); }); }) function displayResults(items) { if (items.length > 0) { var html = "" for (var i = 0; i < items.length; i++) { html += '
  • '+items[i].title+'
  • '; } $('ol#results').html(html) } else { $('ol#results').html("
  • Nothing found.
  • "); } } %input{:type => "text", :placeholder=>"Search"} %ol#results %li.none Please enter a search term.