문제

if(this.all.length > 0){
    for(var k=0; k<this.all.length; k++){               
        alert(this.all[k]);  // it alerts [object FileList] 
        var file = this.all[k];
        this._uploader(file,0);
    }
}
도움이 되었습니까?

해결책

if(this.all.length > 0){
    for(var k=0, len = this.all.length; k < len; k++){               
        console.dir(this.all[k]);  // will iterate over the properties of each  [object FileList] in the console
        var file = this.all[k];
        this._uploader(file,0);
    }
}

다른 팁

If you want to do this for debugging purposes, I suggest you to use console.log:

console.log(this.all[k])

If you insist on alerting the thing for whatever reason, you can serialize it with JSON.stringify:

JSON.stringify(this.all[k])

However, console.log is really much nicer: less annoying, and you can inspect the objects easily.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top