what’s weird about my error is that it ONLY occurs in the firefox extension I have linked to at the bottom of this post. I cannot reproduce this error in any other setting.
I have this ajax request
$.ajax({
type: "GET",
dataType: "jsonp",
url: url,
jsonpCallback: "JSONCallback",
data: {title:$("#txtTitle").val(), url:taburl},
success: function(data, textStatus) {
if(data.code > 0)
{
$("#icon").removeClass().addClass('accept');
}
else
{
$("#icon").removeClass().addClass('error');
if(data.code == '-1')
alert('kunne ikke finde din ønskeseddel på e-ønsker.dk - besøg e-ønsker.dk, og prøv derefter igen');
}
},
error: function(xhr, textStatus, errorThrown) {
alert("XMLHttpRequest="+xhr.responseText+"\ntextStatus="+textStatus+"\nerrorThrown="+errorThrown);
$("#icon").removeClass().addClass('error');
}
});
server returns
JSONCallback({"code":405});
headers are application/json
so why am I getting a parseError saying JSONCallback was not called? I thought jQuery was supposed to handle that for me?
the code is from http://builder.addons.mozilla.org/addon/1022928/latest and the file in question is data/panel.js
The problem is with
window. The easiest way to fix this will be to edit the jQuery code (I know, I hate doing this too) to useunsafeWindowrather thanwindow.