fancongcong

下载地址:http://malsup.com/jquery/form/#download

Github主页:https://github.com/malsup/form 

中文在线文档:http://www.vaikan.com/docs/jquery.form.plugin/jquery.form.plugin.html

英文在线文档:http://jquery.malsup.com/form/

 

上传图片

触发事件:

 

<script type = "text/javascript">
	//使用插件 jquery.form.js
	
	function uploadPic()
	{
		var options = 
		{
			url : "/upload/uploadPic.do",
			dataType: "json",
			type : "post",
			success: function()
			{
				$("#allUrl").attr("src","图片路径");
				$("#imgUrl").val("图片路径");
			}
		}
	
		$("#jvForm").ajaxSubmit( options );//上传
	}

</script>


<form id = "jvForm" >
	<img  id = "allUrl" src = "" /> <-- 显示图片 -->
	<input id = "imgUrl" type = "hidden" name = "imgUrl"  value = "" > <-- 图片的隐藏域 -->
	<input type = "file" name = "pic" onchange = "uploadPic()" / >
</form>

  

分类:

技术点:

相关文章:

  • 2021-11-21
  • 2022-12-23
  • 2022-12-23
  • 2022-02-04
  • 2022-02-14
  • 2021-07-25
  • 2021-12-09
  • 2021-06-23
猜你喜欢
  • 2022-12-23
  • 2022-01-05
  • 2021-12-22
  • 2021-07-28
  • 2022-12-23
  • 2022-12-23
  • 2021-12-18
相关资源
相似解决方案