首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

js 获取图片途径 IE 火狐的差异~

2012-07-30 
js 获取图片路径 IE 火狐的差异~!scriptfunction test(){var Pic document.getElementById(picurl).

js 获取图片路径 IE 火狐的差异~!
<script>
function test()
{
  var Pic = document.getElementById("picurl").value;
  alert(Pic);
}
</script>
<input type="file" name="picurl" id="picurl" onchange="test()" />

IE 下 得到的是 图片的绝对路径 如:c:\test\test.gif
而火狐下却是 test.gif

如何让火狐下也显示绝对路径

[解决办法]
非IE是不能获得路径的,
IE也不是都能获得
需要浏览器设置才可以,你放弃吧
图片预览兼容的方法是采用Flash

热点排行