摘要: 使用iframe来处理异步上传图片,在现在这个时代来说,多多少少都有点落后了!单单就凭AJAX和JS就不能做到异步上传图片了吗?
<div class="jb51code">
<pre class="brush:xhtml;">
<!doctype html>
图片
摘要: 使用iframe来处理异步上传图片,在现在这个时代来说,多多少少都有点落后了!单单就凭AJAX和JS就不能做到异步上传图片了吗?
<div class="jb51code">
<pre class="brush:xhtml;">
<!doctype html>
<script type="text/javascript">
var img;
$("input:file").change(function (){
//console.log(this.files[0]);
lrz(this.files[0],{width:640,quality:0.9},function(rst){
img = rst.base64;
var html = [];
var show_img = new Image();
show_img.src = rst.base64;
$("#img_show").html("
1.首先你要载入JS类库:
2.然后就是写好form