<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <title> New Document </title>
  <meta name="Generator" content="EditPlus">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <script type="text/javascript">

  </script>
 </head>

 <body>
  <form name="form4" > 
	  <input type="file" name="file4"  />
	  <img />
  </form>
  <script type="text/javascript">
  function preview4(){     
	  var x = document.getElementById("file4");     
	  var y = document.getElementById("pic4");     
	  if(!x || !x.value || !y)            return;      
	  var patn = /\.jpg$|\.jpeg$|\.gif$/i;     
	  if(patn.test(x.value)){              
	  y.src = "file://localhost/" + x.value; 
  }else{  
	alert("您选择的似乎不是图像文件。"); 
  }
  }
  </script>
 </body>
</html>

 

相关文章:

  • 2021-07-15
  • 2021-06-22
  • 2022-12-23
  • 2022-01-05
  • 2022-03-05
  • 2021-08-18
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-18
相关资源
相似解决方案