Ajax 文件上传

前端之家收集整理的这篇文章主要介绍了Ajax 文件上传前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <script src="//cdn.bootcss.com/jquery/2.2.0/jquery.min.js"></script>
    <script src="image-upload/js/ajaxFileUpload.js"></script>
    <title>fileUpload</title>
</head>
<body>
<input id="file" type="file" name="file">
<script type="text/javascript"> $(function () { $("#file").change(function () { new AjaxSubmit('file','fileupload.do',{ success : function(data){ alert(data.code); } }).send(); }); }); </script>
</body>
</html>

插件下载链接https://github.com/acrazing/ajaxFileUpload

原文链接:https://www.f2er.com/ajax/162493.html

猜你在找的Ajax相关文章