Wikipedia viewer - Trouble with Autocomplete

In the Wikipedia viewer that I’m currently building, the url for api call is correct but I am not getting the data on console. When I test the url in browser, i get the json data.

code pen

What is happening? I tried getJSON and stringify and then tried with ajax, nothing works.

1 Like

Change the dataType property of the $,ajax call to be “json” with quotes instead of just json.

Moreover, use the chrome developer tools to make sure you have no errors loading dependencies.
For example I get the following error when the page loads:
Uncaught Error: Bootstrap tooltips require Tether (http://tether.io/)

Try Changin the Datatype to jsonp

Thanks a lot! I didnt know about the prevent default thing, thats why the page was reloading everytime.

Thanks everyone !

I put json in quotes and it works now!

Now I have a problem with autocomplete. The chrome console displays some errors but I didnt quite understand them.

lines 12-27 here:

codepen link