1.文件上传,使用jquery.form.js插件库

 

<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script type="text/javascript" src="js/jquery.js"></script>
		<script type="text/javascript" src="js/jquery.form.js"></script>
	</head>
	<body>
	<form >     
 		<input type="file" name="files"  />    
	</form>
	</body>
	<script type="text/javascript">
		var options = {
            success: function (data) {
            	console.log(data)
              
            }
        };
 
        $("#form1").ajaxForm(options);
        $("#file").on("change",function(){        	
        	console.log(this.files)
        	$("#form1").submit();
        })
	</script>
</html>

  

相关文章:

  • 2021-11-17
  • 2022-02-20
  • 2021-12-23
  • 2021-11-19
  • 2021-12-18
  • 2022-02-21
猜你喜欢
  • 2021-11-27
  • 2021-06-27
  • 2021-11-20
  • 2022-02-08
  • 2021-07-05
  • 2022-12-23
  • 2021-06-12
相关资源
相似解决方案