Hello!
I got my queries working with the following code. Try removing your
callback parameter from the url and try this:
$.ajax({
'url': url,
'dataType': 'jsonp',
'cache': true,
'success': ajaxSuccess,
'error': ajaxError
});
Kristian K
08.09.2014 20:34, jim andrews kirjutas:
I read the recent thread on cross-domain AJAX problems with Wikipedia’s API but
I’m still having problems. I’m getting the following error:
XMLHttpRequest cannot load
https://en.wikipedia.org/w/api.php?action=query&list=recentchanges&format=jsonfm&callback=fooblah&gsradius=10000&gscoord=49.288393%7C-123.113268.
No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin
'http://vispo.com' is therefore not allowed access.
That results after I make the following call:
$.ajax({url:url, success:ajaxSuccess, error:ajaxError});
where url is the above url, ajaxSuccess is a function, and so is ajaxError. I
also wrote an accessible function fooblah but it doesn’t get called.
Please advise.
ja
http://vispo.com
-------------------------------------------------------------------------------------------------------------
Brad wrote:
There is a whitelist, stored in the configuration variable
$wgCrossSiteAJAXdomains in CommonSettings.php. This file can be viewed at
[1], or in revision control at [2].
You can query anonymously using JSONP (e.g. [3]), or by querying from your
own server rather than from a webpage. If you are going to be querying from
a webpage, do review the API Etiquette page.[4]
[1]:
https://noc.wikimedia.org/conf/highlight.php?file=CommonSettings.php
[2]:
https://git.wikimedia.org/blob/operations%2Fmediawiki-config.git/master/wmf-config%2FCommonSettings.php
[3]:
https://et.wikipedia.org/w/api.php?action=query&list=recentchanges&format=jsonfm&callback=foobar
[4]:
https://www.mediawiki.org/wiki/API:Etiquette
_______________________________________________
Mediawiki-api mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
_______________________________________________
Mediawiki-api mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api