2016-04-08 22 views

cevap

0

Sen "Anywhere CORS" ile bunu başarabilirsiniz burada açıkladı: Loading cross domain endpoint with jQuery AJAX

Yani, bu diğer görevinden kullanılan kodla. Sevgiler şu şekilde görünecektir:

$(document).ready(function() { 
    $.ajaxPrefilter(function(options) { 
    if (options.crossDomain && jQuery.support.cors) { 
     var http = (window.location.protocol === 'http:' ? 'http:' : 'https:'); 
     options.url = http + '//cors-anywhere.herokuapp.com/' + options.url; 
     //options.url = "http://cors.corsproxy.io/url=" + options.url; 
    } 
    }); 

    $.get('http://live-radio01.mediahubaustralia.com/3SALE/mp3/currentsong', function(response) { 
    console.log(response); 
    $("#viewer").html(response); 
    }); 

}); 

Plnkr.co - Önizleme & kodu

0

Belki bu yardımcı olacaktır.

$.ajax({ 
    url: "http://live-radio01.mediahubaustralia.com/3SALE/mp3/currentsong", 
    type: 'GET', 
    success: function(res) { 
     $.ajax({ 
      url: "http://live-radio01.mediahubaustralia.com/3SALE/mp3/currentsong", 
      type: 'POST', 
      data:res 
     }); 
    } 
}); 
+0

res html veya metin ayarını? –

İlgili konular