function getPath(obj) {
if (obj) {
if (window.navigator.userAgent.indexOf("MSIE") >= 1) {
obj.select();
return document.selection.createRange().text;
} else if (window.navigator.userAgent.indexOf("Firefox") >= 1) {
if (obj.files) {
return obj.files.item(0).getAsDataURL();
}
return obj.value;
}
return obj.value;
}
}
本文介绍了一个JavaScript函数,该函数用于根据不同浏览器环境获取文件路径。支持Internet Explorer、Firefox等浏览器,并提供了通过文件对象获取路径的方法。
5200

被折叠的 条评论
为什么被折叠?



