title: jQuery Autocomplete enter keypress action in Firefox not working properly
body: <p>I made a jQuery autocomplete search to search through pages in my CI application, the returned JSON data includes 2 elements, "slug" of the page and "name" of the page, so im using the "name" to show on autocomplete list, and when someone selects a result or press enter key it redirects him to that page using the slug:</p>
  
  <pre><code>$(function() {
      $( "#search" ).autocomplete({
          source: "index.php/pages/get_pages",
          minLength: 2,
          select: function(event, ui) {
              $(event.target).val(ui.item.value);
              window.location.href = "index.php/pages/" + ui.item.slug;
              return false;
          }
      });
  
      $("#search").keypress(function(e){
          if (e.which == 13) {
              window.location.href = "index.php/pages/no-results";
              return false;
          }
      });
  });
  </code></pre>
  
  <p>now i added another option when someone types a keyword and no results were found then he press enter it should go to the "pages" with no-results parameter.</p>
  
  <p>This code worked fine on all browsers except for Firefox, it goes to no-results page in all cases.</p>
  
  <p>I need it to go to no-results page only if no results were found and the user entered a random page name then pressed enter.</p>