jquery ui autocomplete with database

后端 未结 7 2088
隐瞒了意图╮
隐瞒了意图╮ 2020-12-08 08:41

I fairly new to JQuery and perhaps trying to achieve something that might be abit harder for a beginner. However I am trying to create an autocomplete that sends the curren

7条回答
  •  萌比男神i
    2020-12-08 09:13

    I had a problem like you too. And now I fix it. The problem is my json that return from my server contain a syntax error.

    In http://api.jquery.com/jQuery.getJSON/ tells that if there are some error in JSON, it will fail silently. The JSON must match the JSON standard here http://json.org/ .

    For my error is my string in JSON is wrapping in only one quote. But the JSON standard accept only string that wrap in double quotes.

    eg. "Hello World" not 'Hello World'

    When you fix it you can set the source as string URL. The term will be in "term" query string. And it works!!

提交回复
热议问题