I got this code for the Form:
jQuery
$('#form').ajaxForm({
beforeSend: function () {
bar.width(0);
},
uploadProgress: function (event, position, total, percentComplete) {
var percentCompleted = percentComplete + '%';
bar.width(percentCompleted)
bar.text(percentCompleted)
console.log(percentCompleted);
///The Console logs properly.
},
complete:
//------------------------------------
//THIS IS WHERE LIES PROBLEM IS
//------------------------------------
function (xhr) {
//How do you convert the xhr to JSON?
//I tried :
var out = JSON.parse(xhr)
// and :
var out2 = $.parseJSON(xhr)
console.log('Completed1: ' + out);
console.log('Completed2: ' + out2);
},
error: function (xhr, desc, err) {
console.log(xhr)
console.debug(xhr);
console.log("Desc: " + desc + "\nErr:" + err);
}
});
PHP类似于:
$OutCollection
是一个关联型数组()
Firebug控制台显示:
无法确定究竟有什么问题。
非常感谢任何帮助。
PHP在firebug中的输出/响应
Console.log(xhr)打印
xhr
已经是一个对象了。尝试使用console.log(xhr)
查看一下结果。 - Musaconsole.log(xhr)
的结果... 再次感谢。 - ErickBest