jqueryを使用してhttp://api.arbetsformedlingen.se/からjsonを取得しようとしていますが、機能させることができません。私は4時間試しましたが、今はあきらめます...
クロスドメインの問題かもしれないと思ったので、 http://james.padolsey.com/javascript/cross-domain-requests-with-jquery/を試してみました
そして、すべてがxmlを取得し、この http://www.fyneworks.com/jquery/xml-to-json/を使用しようとしました
しかし、それは機能しませんでした。xmlファイルを取得するためにphp-proxyメソッドを使用したくありません。
APIからjsonファイルを取得できないのはなぜですか?xmlまたはjsonファイルを取得しようとするたびに、空のページが返されます。
これが例の1つです
$(document).ready(function() {
// Checking if jQuery is working
console.log("jQuery running");
var myurl="http://api.arbetsformedlingen.se/platsannons/soklista/kommuner?lanid=10";
console.log(" call back url :"+ myurl);
$.ajax({
url: myurl,
type: 'Get',
cache: false,
contentType: 'application/json; charset=utf-8',
dataType: 'json',
success: function(json) {
console.log(" reponse :"+ json);
}
});
});