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

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -