0

I am trying to retrieve suggest queries from google's API and I keep getting an error:

Uncaught TypeError: Property 'source' of object #<Object> is not a function

The file is being parsed properly and in firebug/dev tools it shows that the callback is being retrieved without any errors. It seems to be an autocomplete error.

jsFiddle: http://jsfiddle.net/xrDjk/

1 Answer 1

1

You should be using the source attribute, since the jQuery UI autocompleter depends on it. There is an example in the autocompleter documentation. You can move your existing .ajax function as in the demo.

Sign up to request clarification or add additional context in comments.

7 Comments

It actually makes no difference. This is a known working way.
Thanks for replying btw. I would give a bounty if you can provide a quick fiddle? Or I can make you one because I've tried it and it really doesn't work. Thanks
Here is the version with source attribute sir: jsfiddle.net/XXcHE On this one I don't get console errors but yet again the autocomplete doesn't work.
@jQuerybeast We use the word "working" differently, I think ;) Sure looks like it's looking for a source attribute--but ok. In any case, it comes back with a parseerror response--the Google response is an array, not an object, apparently. I tried using jsonp text as the dataType but that didn't fix it.
So that's why my first method should work. It takes all the arrays and sets them into an autocomplete
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.