Javascript JQuery视频上载返回成功消息,但正在触发错误事件
我有API在wistia服务器上传视频。我使用Ajax jquery将视频发布到服务器,视频被上传到服务器,成功消息就来了。但问题是,错误事件会被解雇,成功事件中不会有任何结果 HTML: 答复:Javascript JQuery视频上载返回成功消息,但正在触发错误事件,javascript,jquery,ajax,wistia,Javascript,Jquery,Ajax,Wistia,我有API在wistia服务器上传视频。我使用Ajax jquery将视频发布到服务器,视频被上传到服务器,成功消息就来了。但问题是,错误事件会被解雇,成功事件中不会有任何结果 HTML: 答复: {"readyState":4,"responseText":"{\"id\":16549615,\"name\":\"VID-20151103-WA0000.mp4\",\"type\":\"Video\",\"created\":\"2015-11-03T10:28:25+00:00\",\"up
{"readyState":4,"responseText":"{\"id\":16549615,\"name\":\"VID-20151103-WA0000.mp4\",\"type\":\"Video\",\"created\":\"2015-11-03T10:28:25+00:00\",\"updated\":\"2015-11-03T10:28:25+00:00\",\"duration\":112.046,\"hashed_id\":\"********\",\"description\":\"\",\"progress\":0.0,\"status\":\"queued\",\"thumbnail\":{\"url\":\"https://embed-ssl.wistia.com/deliveries/5b83b5db28f38876963829e0de30039d52eb80bc.jpg?image_crop_resized=100x60&video_still_time=56\",\"width\":100,\"height\":60},\"account_id\":******}","status":200,"statusText":"OK"}
这是一个错误事件。。。。错误是…?@Rorymcrossan No error它在错误事件中显示成功消息。响应的HTTP状态是什么?您是否检查了控制台的“网络”选项卡以查看实际响应?检查我是否发布了在错误事件中得到的响应。
function SaveFile() {
alert('111111');
var pData = new FormData();
var files = $("#File1").get(0).files;
pData.append("project_id", "*******");
pData.append("file", files[0]);
$.ajax({
url: 'https://upload.wistia.com/?access_token=***************',
type: 'POST',
data: pData,
processData: false,
contentType: false,
dataType: 'multipart/form-data',
async: false,
success: function (data) {
alert('success');
},
error: function (e) {
alert(JSON.stringify(e));
alert('error');
}
}).done(function () {
alert('Done');
});
{"readyState":4,"responseText":"{\"id\":16549615,\"name\":\"VID-20151103-WA0000.mp4\",\"type\":\"Video\",\"created\":\"2015-11-03T10:28:25+00:00\",\"updated\":\"2015-11-03T10:28:25+00:00\",\"duration\":112.046,\"hashed_id\":\"********\",\"description\":\"\",\"progress\":0.0,\"status\":\"queued\",\"thumbnail\":{\"url\":\"https://embed-ssl.wistia.com/deliveries/5b83b5db28f38876963829e0de30039d52eb80bc.jpg?image_crop_resized=100x60&video_still_time=56\",\"width\":100,\"height\":60},\"account_id\":******}","status":200,"statusText":"OK"}