Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re: perl jquery script returns http status undefined sometimes

by derby (Abbot)
on Aug 21, 2012 at 22:13 UTC ( #988892=note: print w/replies, xml ) Need Help??

in reply to perl jquery script returns http status undefined sometimes

Well ... for starters, the problem could be loads of different things but I'm guessing the results from your DB query are not in the format jquery autocomplete expects them to be:

The data from local data, a url or a callback can come in two variants +: An Array of Strings: [ "Choice1", "Choice2" ] An Array of Objects with label and value properties: [ { label: "Choice1", value: "value1" }, ... ]
Also ... I'm unsure but you may have to set the content-type to 'application/json' on the response. I do that but I cannot remember if I *needed* to or if I just thought it was good form.

As for the console, the autocomplete widget has some delays built into it so it doesn't swamp the server, if you type normal speed, you may not see an ajax request for each letter -- try typing slower to see ajax call per letter.


Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://988892]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (4)
As of 2022-05-29 12:17 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (101 votes). Check out past polls.