In the stub code below, when the error: method is invoked, the "errorThrown" variable just returns "object Object".
How can I get it to print out the actual text?
jQuery.ajax
({
contentType: "application/json; charset=utf-8",
dataType: "json",
url: myURL,
success: function(data)
{
if(data['response'] === undefined){
this.error('No data returned');
}
//success code goes here
},
error: function(errorThrown)
{
result += errorThrown;
alert('The error was: '+errorThrown);
return;
}
});