Here is how I'm using jsonp:
I'm trying to GET an Assignment
$.ajax({
type: "GET", // Type of request to be send
url: canvasapi, // url+token to which the request is sent
contentType: "application/json; charset=utf-8",
dataType: "jsonp", // type of data
success: function(data, status, jqXHR)
{
console.log( "success status: "+status );
console.log( "success data: "+data );
console.log( "success xhr text: "+jqXHR.responseText );
},
jsonp: false, // should use Callback below
jsonpCallback: function(data)
{
//var asgndata = JSON.parse(data);
//console.log( "jsonp asgndata: "+asgndata );
console.log( "jsonp data: "+data );// undefined - parsererror in returned data
},
error: function (jqXHR, status)
{
console.log( "ERR status: "+status );
console.log( "ERR xhr text: "+jqXHR.responseText );
}
});
It makes it past the CORS cross domain
But I'm getting a parser error so it data is undefined
