Can anyone elaborate on what might be going wrong? I have no real clue on what to look for at this point.
sample code:
$.ajax({
url: uploader.fileupload('option', 'url'),
context: uploader,
success: function(response){
//logging uploader
console.log(uploader);
//logging this --> logs the same as logging uploader
console.log(this);
//loggin response --> clearly shows a context attribute holding the correct data for this response
console.log(response);
//logging response.context --> shows undefined
console.log(response.context)
var done = uploader.fileupload('option','done');
done.call(this, null, response);
},
dataType:"json"
})
I'm not used to working with the context attribute in $.ajax() call and i'm suspecting this functionality to cause my issue.
The snippet causes issues in my code some time after the ajax call. I'm pretty sure this has nothing to do with ASYNC problems, since problem allready exists way back in the actual success-callback of the original ajax-request.
I've disabled php-headers which were sent, but it remains the same. I tried this based on another topic which implies something could be wrong with my headers. I've also disabled the dataType attr in $.ajax() but then my response isn't recognised as being json.
Any help or tips on how to debug are much appreciated!
UPDATE: removing the context attribute in the ajax-call does solve the issue. But why does it get appended to my response object (or at least seems to be appended) when console.logging()