Wikipedia viewer json problem

Wikipedia viewer json problem
0.0 0


okay that’s strange and it happened for second time
i made simple page for wikipedia viewer
and when i start to use $.getJSON() it stop
so that is my project

if i wrote
before the call of $.getJSON()it work fine or after also
but inside the call it doesn’t work and i don’t know why
with weather api also this happened and i solve it by
use of toString() here every value i used string
and i try to use
and not work also so what is my wrong please


Forms refresh the page by default when you hit the Submit button (as in this case). Modify your click handler to prevent refreshing like so:

$('#btn').click(function(event) {

  // ... rest of your code ...

After that, you’ll encounter a CORS issue with the JSON request. You can add origin=* in the Wikipedia URL parameters to allow the request.

After that, you’ll encounter a logic error, but I’ll leave it to you to fix it :wink:


will thank you
i change $.getjson to $.jax() and it respond to request
but it return string now not object at all and i don’t understand why
i use alert (typeof(json)) to know that
why that


I think you missed this:

  url: req,
  // ...


thank you
you helped me alot