Alex
Alex

Reputation: 397

typeahead - parsing a json array from a remote URL

I'm trying to create an auto-suggest city with type-ahead and have the following:

http://jsfiddle.net/m0ojmpqv/

However, when typing I don't seem to get any auto-suggestion.

Could anybody point me in the right direction? I'm a little lost with typeahead!

Thanks :-)

<input class="typeahead"></input>

Upvotes: 0

Views: 163

Answers (1)

Rajdeep Dosanjh
Rajdeep Dosanjh

Reputation: 1187

The problem is CORS the API your using doesn't allow send back data with 'Access-Control-Allow-Origin: *' hence the browser blocks it and type ahead swallows the problem.

I suggest finding a new API or using a json file.

Upvotes: 1

Related Questions