Open CuAnnan opened 11 years ago
By adding responseType:'JSON' to the default_opts and adding an if statement to the xhr.onload which checks opts.responseType like so:
if(opts.responseType == 'JSON') { var result = opts.uploadFinished(index, file, jQuery.parseJSON(xhr.responseText), timeDiff); } else if(opts.responseType == 'XML') { var result = opts.uploadFinished(index, file, jQuery.parseXML(xhr.responseText), timeDiff); } else { var result = opts.uploadFinished(index, file, {}, timeDiff); }
you can allow response-agnostic uploading.
By adding responseType:'JSON' to the default_opts and adding an if statement to the xhr.onload which checks opts.responseType like so:
if(opts.responseType == 'JSON') { var result = opts.uploadFinished(index, file, jQuery.parseJSON(xhr.responseText), timeDiff); } else if(opts.responseType == 'XML') { var result = opts.uploadFinished(index, file, jQuery.parseXML(xhr.responseText), timeDiff); } else { var result = opts.uploadFinished(index, file, {}, timeDiff); }
you can allow response-agnostic uploading.