<input type="file" id="fileAtt" onchange="fileChange()"  />
<script type="text/javascript" > var s = document.getElementById('fileAtt');s.select();var realpath = document.selection.createRange().text;</script>先上代码。
在浏览器安全设置下将文件路径设置成不显示本地真实路径后,想在JS中获取到file中的真实路径,以上我的解决方法在IE8和360 5.0下运行都是可以得到的,但是在360 6.1下发现document.selection为undefined,请教各位大神原因,以及解决方案。javascript