I\'m trying to call my remote url with added attributes to the url.
For now I have this working:
$(\'#league\').typeahead({
remote: \'/typeah
Here is a complete example with the QUERY result as well passed. Note that when the remote method is used variable substitution no longer functions. Thanks to hieu-nguyen for the majority of it!
jQuery('#city').typeahead({
name: "cities",
remote: {
url: current_web_root + '?action=ajax|getcities&query=%QUERY',
replace: function () {
var q = current_web_root + '?action=ajax|getcities&query=' + jQuery('#city').val();
if (jQuery('#state').val()) {
q += "&state=" + encodeURIComponent(jQuery('#state').val());
}
return q;
}
},
cache: false
});
jQuery("#state").change(function (e) {
jQuery('#city').val("");
});