How to get data from mediawiki api using Angularjs? -
while try access wiki api using angularjs $http.get(), cors issues occured. here code
$http.get('http://en.wikipedia.org/w/api.php?action=query&prop=extracts&format=json&exintro=&titles=india') .success(function(data){ console.log('data' +data); });
and error message
xmlhttprequest cannot load https://en.wikipedia.org/w/api.php?action=query&prop=extracts&format=json&exintro=&titles=india. no 'access-control-allow-origin' header present on requested resource. origin 'null' therefore not allowed access.
use jsonp cross-site requests.
Comments
Post a Comment