title: jQuery AutoComplete error: "s is undefined". How can I resolve this?
body: <p>I'm using <a href="http://docs.jquery.com/Plugins/autocomplete" rel="nofollow">jquery.autocomplete.js</a>, and the following JS:</p>
  
  <pre><code>$("#Search").autocomplete("/uk/Search/AutoComplete",
  {
      dataType: 'json',
      parse: function (data) {
          var rows = new Array();
          for (var i = 0; i &lt; data.length; i++) {
              rows[i] = { data: data[i], value: data[i].Tag, result: data[i].Tag };
          }
          return rows;
      }, max: 20,
      formatItem: function (row, i, max) {
          return row.Tag;
      },
      width: 300,
      minChars: 4,
      highlight: false,
      multiple: false
  });
  </code></pre>
  
  <p>This all works fine, and I can see that there is a server round-trip going on, and the result I expect is in the <code>data</code> variable. </p>
  
  <p>The problem I have is that I can see in the FireFox Error Console that there is an error stating <code>s is undefined</code>.</p>
  
  <p>It's failing on the following:</p>
  
  <pre><code>$.Autocompleter.Cache = function(options) {
  
      var data = {};
      var length = 0;
  
      function matchSubset(s, sub) {
          if (!options.matchCase)
              s = s.toLowerCase(); // this is where it fails
          var i = s.indexOf(sub);
          if (options.matchContains == "word") {
              i = s.toLowerCase().search("\\b" + sub.toLowerCase());
          }
          if (i == -1) return false;
          return i == 0 || options.matchContains;
      };
  </code></pre>
  
  <p>Why would this be failing? Is there anything I can do to fix it?</p>