日期:2014-05-16  浏览次数:20415 次

关于火狐浏览器中使用文件上传疑惑!
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script language="javascript">
function a() {  
  document.getElementById("abc").src = document.getElementById("File1").value;
  } 
</script>
</head>

<body>
<input id="File1" type="file" onchange="a()" />
<img id="abc" /> 
</body>
</html>

这段代码在火狐浏览器中不支持,不知道是什么原因,请问那个高手遇到过没有,在IE中很正常。

------解决方案--------------------
安全性的原因
------解决方案--------------------
你可以采用这个方法
http://topic.csdn.net/u/20091222/00/2da91ff1-9bb2-431c-8ddf-bb3011d7efbe.html