ie7下javascript中获取input type=file中的内容
2010-11-11 11:57
381 查看
var file1= document.getElementById("file1").value;
// 判断浏览器类型,防止浏览器将文件路径设为C:/fakepath/
var isIE = (document.all) ? true : false;
var isIE7 = isIE && (navigator.userAgent.indexOf('MSIE 7.0') != -1);
var isIE8 = isIE && (navigator.userAgent.indexOf('MSIE 8.0') != -1);
if(isIE7 || isIE8)
{
var file = document.getElementById("file1");
file.select();
file1= document.selection.createRange().text;
document.selection.empty();
}
// 判断浏览器类型,防止浏览器将文件路径设为C:/fakepath/
var isIE = (document.all) ? true : false;
var isIE7 = isIE && (navigator.userAgent.indexOf('MSIE 7.0') != -1);
var isIE8 = isIE && (navigator.userAgent.indexOf('MSIE 8.0') != -1);
if(isIE7 || isIE8)
{
var file = document.getElementById("file1");
file.select();
file1= document.selection.createRange().text;
document.selection.empty();
}
相关文章推荐
- Javascript获取IFrame内容(兼容IE&FF)
- javascript获取iframe文档内容(兼容IE和Firefox)
- javascript获取textarea光标位置,内容方法(IE, Firefox)
- javascript获取textarea光标选择位置和内容方法(IE, Firefox)
- Javascript获取IFrame内容(兼容IE&FF)
- 用Javascript获取Iframe中的内容(兼容IE&firefox)
- javascript获取textarea光标选择位置和内容方法(IE, Firefox)
- 兼容IE和Firefox的javascript获取iframe文档内容的变量
- Javascript获取IFrame内容(兼容IE&FF)
- javascript获取iframe文档内容(兼容IE和Firefox)
- Javascript获取IFrame内容(兼容IE&FF)
- Javascript获取IFrame内容(兼容IE&FF)
- javascript获取textarea光标选择位置和内容方法(IE, Firefox)
- 兼容IE和Firefox的javascript获取iframe文档内容的函数
- javascript获取textarea光标选择位置和内容方法(IE, Firefox)
- Javascript获取IFrame内容(兼容IE&FF) (转)
- 兼容IE和Firefox的javascript获取iframe文档内容的函数
- javascript获取textarea光标选择位置和内容方法(IE, Firefox)
- Javascript获取IFrame内容(兼容IE&FF)
- javascript获取textarea光标位置,内容方法(IE, Firefox)