twitter/typeahead.js — pull request #356 by recallfx (2013-07-22 03:53:28+00:00)
Title: Override Ajax requests with custom method

Override Ajax requests with custom method still using all of transport functionality.

This is different approach to issues #95, #206 and #232, than in pull request #220.

Basically we are replacing `$.ajax(url).done(done)` with `this.override(url, done)`, this way we still have caching and request threshold.

Usage could be as simple as this:
```
$('.override').typeahead({
remote : {
url : '%QUERY',
override : function(query, done){
setTimeout(function() {
done(['one', 'two', 'three']);
}, 500);
}
}
});
```
Note, that query is encoded, so `url` must be the same as `wildcard`;