That is a jsonp request described here
https://www.mediawiki.org/wiki/API:Cross-site_requests
jsonp requests are made via a <script>
tag in the HTML page which is a bit of a pain - JSON_CALLBACK
is the name of your callback function to process the data returned by the <script>
tag - something like
function dojsonp(data) {
console.log(JSON.stringify(data))
}
the <script>
tag can be static or dynamic
The wiki doc above mentions the alternative cors request using an origin=*
parameter that can be made with XMLHTTPRequest
- I had to urlencode “*” below as “%2a” to prevent the url being modified by this forum posting software but you don’t have to do that
Thanks very much.
I will be honest with you, its not crystal clear to me but still I have learned something here.
These are good references for web APIs - they are not easy to grok - use them more as goalposts to get you started kicking the ball
https://developer.mozilla.org/en-US/docs/AJAX
You may get more help on this forum if you tell the forum what you’re trying to do and the issues you face
To be honest I don’t know, I’m going to try and figure it out at some point, I removed from the URL and my script worked fine.
That was not the case with me, for me after removing the part I didn’t get any JSON.