ajax - Kango Extension Cross Domain Request -
i'm new working kango , have setup basic extension already. conversion existing extension , far. however, docs feel little light when comes doing ajax call cross-domain.
this existing code worked 100% in other extension framework:
$.ajax({ url:url, success:function(data){ alert("success!") } });
i'm seeing 200 ok response, response empty , never see alert.
i'm guessing comes down need use kango api? i've tried of documentation samples , nothing seems working. above inside content script, if matters. i'm trying pull file , read contents, seems more difficult should be.
if wan't perform cross domain request content script, should use kango.xhr.send:
kango.xhr.send({url: 'http://example.com/'}, function(data) { if (data.status == 200 && data.response) { kango.console.log(data.response); } else { kango.console.log('something went wrong'); } });
Comments
Post a Comment