firefox javascript如何打开本地文件对话框
var inputObj=document.createElement('input')
inputObj.setAttribute('id','_ef');
inputObj.setAttribute('type','file');
inputObj.setAttribute("style",'visibility:hidden');
document.body.appendChild(inputObj);
inputObj.click();
inputObj..value
这是模拟打开本地文件对话框的例子得到选中的文件
但是在firefox 不能打开文件对话框
var excelfile=new Ext.form.TextField({
id:'excelfile',
name:'file',
style:'display:none',
labelSeparator:'',
inputType:'file'
});
var s = document.getElementById("excelfile");
s.click();
s.value;
这个也只能在firefox下打开本地文件对话框
请大家帮我看看有有好的解决办法