Modify ↓
Ticket #2970 (closed bug: invalid)
[autocomplete] Searching for "#" translates into a blank string
| Reported by: | joelz | Owned by: | stefan |
|---|---|---|---|
| Priority: | major | Milestone: | 1.3 |
| Component: | interface | Version: | 1.2.5 |
| Keywords: | autocomplete | Cc: | |
| Blocking: | Blocked by: |
Description
When you do a search for anything involving the '#' character and extra params, the browser forms the url like http://[searchUrl]?q=#state=1, which means that the browser will think anything after the "#" is part of the hash, and it won't look it up correctly. It also things that the search is for an empty string.
All you have to do to fix it is move the "q" param to the end of the url, here's the fix for makeUrl:
function makeUrl(q) {
var url = options.url + "?";
for (var i in options.extraParams) {
url += i + "=" + encodeURI(options.extraParams[i]) + "&";
}
url += "q=" + encodeURI(q);
return url;
};
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

Not a jQuery core bug.