Skip to content

Instantly share code, notes, and snippets.

@np422
Created February 6, 2012 15:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save np422/1752784 to your computer and use it in GitHub Desktop.
Save np422/1752784 to your computer and use it in GitHub Desktop.
git diff ccb9ebe0ed59f41a59da84b7c74962886f6cceef..be3d311a71a91dc4142472b3d35e4ee52740f009 -- jquery.tokeninput-v2.js
diff --git a/public/javascripts/autocomplete/jquery.tokeninput-v2.js b/public/javascripts/autocomplete/jquery.tokeninput-v2.js
index fc0a765..85a9aa6 100644
--- a/public/javascripts/autocomplete/jquery.tokeninput-v2.js
+++ b/public/javascripts/autocomplete/jquery.tokeninput-v2.js
@@ -795,9 +795,6 @@
populate_dropdown(query, settings.jsonContainer ? results[settings.jsonContainer] : results);
}
- var queryStringDelimiter = settings.url.indexOf("?") < 0 ? "?" : "&";
- var url = settings.url + queryStringDelimiter + settings.queryParam + "=" + encodeURIComponent(query)
-
var type = "GET";
if(settings.method == "POST") {
@@ -807,10 +804,13 @@
// Increase request count
request_count++;
+ var data = { "type_limit": settings.typeLimit, "max_limit": settings.maxLimit }
+ data[settings.queryParam] = encodeURIComponent(query);
+
$.ajax({
type: type,
- url: url,
- data: {},
+ url: settings.url,
+ data: data,
success: callback,
dataType: settings.contentType,
// Set the request count as the context to be
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment