var arr = new Array ("001","002","003");
var file = document.getElementById('file').files[0];
if (file)
{
i = String(file.name);
arr.prototype.push.apply([i]);
}
利用file button選取檔案抓取檔名
並且把檔名強制轉為字串
然後使用push新增到陣列
請問這樣寫對嗎?
for(j=0;j<=arr.length;j++)
{
i = String(file.name);
arr.prototype.push.apply(???);
}
document.write(arr);
}
如果要使用for迴圈的話是要這樣寫嗎?