Dear gurus, help is not as I do not understand how I parse https url json through jquery did this:

var myurl = "http://hws.m.taobao.com/cache/wdetail/5.0/?id=538910539466"; $.ajax({ dataType: "json", url: myurl + '&callback=?', }).done(function ( data ) { alert(data); }); 

But I get errors: Access-Control-Allow-Origin

PS Sparsed this url via curl php but answer is very long, it seems to me if I try to try through js I think the answer will be fast.

  • via js, it will only work if the host throws the header "Access-Control-Allow-Origin: *" those are allowed to everyone (well, or specifically your domain will return where you make the request). otherwise ajax request cannot be made. do it via php - noadev

1 answer 1

Try

 var myurl = "//hws.m.taobao.com/cache/wdetail/5.0/?id=538910539466"; $.ajax({ dataType: "json", url: myurl + '&callback=?', }).done(function ( data ) { alert(data); });