Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: perl jquery script returns http status undefined sometimes

by derby (Abbot)
on Aug 21, 2012 at 22:13 UTC ( [id://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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (6)
As of 2024-04-25 10:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found