摘要: html代码: <input type="file" id="file1"/> jq代码: $('#file1').change(function(e){ var imgBox = e.target; uploadImg($('.file1'), imgBox) }); function uploa 阅读全文
posted @ 2018-12-21 18:50 代码书写人生 阅读(1750) 评论(0) 推荐(0) 编辑
摘要: html代码 <img src="/img/zhengmian.png" alt="" class="file1"> <input type="file" id="file1" style="display:none;"/> jq代码 //上传头像$(function () { $(".file1" 阅读全文
posted @ 2018-12-21 18:47 代码书写人生 阅读(334) 评论(0) 推荐(0) 编辑
摘要: html <input type="file" id="file1" /> jq代码 var formData = new FormData(); formData.append("myfile", document.getElementById("file1").files[0]); //获取图片 阅读全文
posted @ 2018-12-21 18:45 代码书写人生 阅读(180) 评论(0) 推荐(0) 编辑