jquery ui autocomplete with database

后端 未结 7 2107
隐瞒了意图╮
隐瞒了意图╮ 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条回答
  •  我在风中等你
    2020-12-08 09:11

    some suggestions:

    1. Why dataType= "jsop"? It doesn't appear to be jsonp. I think you want "json".
    2. insert a cache : false in the options, as well. This insures the request is always made, and never satisfied from browser-side cache.
    3. check if the call is going out, with something like Fiddler or Charles.
    4. does your success fn get called? You have a alert() there. Does it get invoked?
    5. if you have Firebug or the IE8 developer tools, you can put a breakpoint on the alert() to verify the value of the parameters.
    6. Why specify the full hostname in the URL? Last night I had an odd situation with autocomplete where the response was null, the empty string, when I used a different hostname for the page and the Ajax request. When I modified it to use the same hostname, the request succeeded. Actually because of the same origin policy, you should have no hostname at all in the URL for the ajax call.

提交回复
热议问题