Comments (6)
The data is pre-parsed by jQuery. Internally I call $.ajax() on every request.
Check the raw response of your Java method, because it seems to me that you're
returning a string. I've tested this with objects and arrays, no problems.
The raw response for an array should be:
["Ajax","Ajax-Typeahead"]
Can you confirm that this is what you're receiving?
from ajax-typeahead.
Paul, sorry for the delay in getting back to you -- I was on vacation over the weekend.
Sorry for this - you're right. When I booted the machine this morning and removed the ref to $.parseJSON(data), it just worked. I had definitely tried it originally without that and it wasn't working; guess I'm going to chalk it up to my IDE being out-of-sync or something since I rarely reboot or restart GF.
Thanks for the awesome code, yours is the better of the options I've seen and is very flexible.
:)
from ajax-typeahead.
Glad to hear it works for you Brandon.
You're welcome
from ajax-typeahead.
Hey pwarelis, great added functionality that I'm trying to use.
I'm having the same issue bane73 was.
Eg.
If I simply hard code a ajax reply from php as echo '["Ajax","Ajax-Typeahead"]'; or echo json_encode('["Ajax","Ajax-Typeahead"]');
What is returned becomes, ["Ajax","Ajax-Typeahead"] or "["Ajax","Ajax-Typeahead"]"
and every individual letter becomes a result item the way bane73 describes.
Doing my head in, not sure what I should be returning to get whole words :)
Thanks
from ajax-typeahead.
header('Content-type: application/json');
echo json_encode(array("string1", "string2"));
exit;
from ajax-typeahead.
ah, awesome
Thanks for your help
from ajax-typeahead.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ajax-typeahead.