Bug Tracker

Opened 11 years ago

Closed 9 years ago

#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:
Blocked by: Blocking:

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 (1)

comment:1 Changed 9 years ago by dmethvin

Resolution: invalid
Status: newclosed

Not a jQuery core bug.

Note: See TracTickets for help on using tickets.