来源:http://topic.csdn.net/u/20091110/16/e80ba2fc-59fa-4e2a-b4d7-8f068b4d5597.html

 

下面方法是直接解析图片,并用img.src显示

<script >
function getFullPath(obj){
if(obj){
//ie
if (window.navigator.userAgent.indexOf("MSIE")>=1){
obj.select();
return document.selection.createRange().text;
}
//firefox
else if(window.navigator.userAgent.indexOf("Firefox")>=1){
if(obj.files){
return obj.files.item(0).getAsDataURL();
}
return obj.value;
}
return obj.value;
}
}
</script>
<input type="file" onChange="img1.src=getFullPath(this)"><br>
<img name="img1" id="img1">

 

相关文章:

  • 2021-11-17
  • 2021-09-06
  • 2022-12-23
  • 2021-10-09
  • 2021-12-25
  • 2022-02-23
  • 2021-08-30
猜你喜欢
  • 2022-12-23
  • 2021-09-17
  • 2022-12-23
  • 2021-11-27
  • 2021-08-08
  • 2022-02-18
  • 2022-12-23
相关资源
相似解决方案