jquery - JSONP .ajax request with basic authentication -
i trying request jsonp output external api requires basic authentication. have code below access it:
$.ajax({ url: "https://api.example.com/photos/highest-rated?gender=f", datatype: "jsonp", beforesend: function(xhr) { xhr.setrequestheader("authentication", $.base64.encode(device_id + ":" + secret_key)); }, success: function(json) { alert('works'); }, error: function (jqxhr, textstatus, errorthrown) { alert (textstatus); alert (errorthrown); }
the resulting errors are:
textstatus = "parsererror" errorthrown = "error: jquery18306713019642047584_1367530194009 not called"
i'm using jquery plugin base64 encoding: https://github.com/carlo/jquery-base64.
does know i'm doing wrong?
Comments
Post a Comment