Bug Tracker

Modify

Ticket #2970 (closed bug: invalid)

Opened 5 years ago

Last modified 3 years ago

[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

comment:1 Changed 3 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to invalid

Not a jQuery core bug.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.