基于 iframe 文件上传的 jQuery Ajax 传输插件 jQuery-Iframe-Transport

码农软件 · 软件分类 · jQuery 文件上传 · 2019-12-13 19:29:45

软件介绍

jQuery-Iframe-Transport 是一个基于 iframe 文件上传的 jQuery Ajax 传输插件,通过隐藏的 iframe 来实现传输。

要使用这个插件,只需简单的添加一个值为 true 的 iframe 选项到设置了 $.ajax() 调用的 Ajax 中,然后使用 files 选项指定要包含在子控件中的文件字段,该选项可以是选择器、jQuery 对象或包含一个或多个 <input type="file"> 元素的 DOM 列表:

$("#myform").submit(function() {
    $.ajax(this.action, {
        files: $(":file", this),
        iframe: true
    }).complete(function(data) {
        console.log(data);
    });
});

该插件将构造隐藏的 <iframe><form> 元素,然后将文件字段添加到该表单,并提交表单处理响应。

本文地址:https://www.codercto.com/soft/d/21082.html

Web Design Handbook

Web Design Handbook

Baeck, Philippe de 编 / 2009-12 / $ 22.54

This non-technical book brings together contemporary web design's latest and most original creative examples in the areas of services, media, blogs, contacts, links and jobs. It also traces the latest......一起来看看 《Web Design Handbook》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

随机密码生成器
随机密码生成器

多种字符组合密码