I try to fetch data from wikilocation.org. As far as i get it, i need to use jsonp to manage this. This basically works with this code:
$.ajax({
url:'http://api.wikilocation.org/articles',
dataType: "jsonp",
cache: false,
jsonp:'onJsonPLoad',
jsonpcallbackString: "addPoi",
data: {'lng': newPoi.lon, 'lat': newPoi.lat, 'limit':5, 'radius':100, 'jsonp':'addPoi'}
});
My problem is, that i do not want to call another function (addPoi in the snippet) to be able to work with the result. I neet the result directly inside the function, where i make the ajax call. Is that possible? Am I missing something?
This will work: Example
You have to send wikilocation a function name, and tell jQuery what to expect like you did. Then all you needed to do was add the
success: function (data) { ... }