Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
Perl-Sensitive Sunglasses
 
PerlMonks  

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.

-derby


Comment on Re: perl jquery script returns http status undefined sometimes
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2014-04-20 16:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (485 votes), past polls