<!DOCTYPE HTML>
<!--
/*
* jQuery File Upload Plugin postMessage API 1.1.1
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2011, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
-->
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery File Upload Plugin postMessage API</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
</head>
<body>
<script>
/*jslint unparam: true, regexp: true */
/*global $, Blob, FormData, location */
'use strict';
var origin = /^http:\/\/example.org/,
target = new RegExp('^(http(s)?:)?\\/\\/' + location.host + '\\/');
$(window).on('message', function (e) {
e = e.originalEvent;
var s = e.data,
xhr = $.ajaxSettings.xhr(),
f;
if (!origin.test(e.origin)) {
throw new Error('Origin "' + e.origin + '" does not match ' + origin);
}
if (!target.test(e.data.url)) {
throw new Error('Target "' + e.data.url + '" does not match ' + target);
}
$(xhr.upload).on('progress', function (ev) {
ev = ev.originalEvent;
e.source.postMessage({
id: s.id,
type: ev.type,
timeStamp: ev.timeStamp,
lengthComputable: ev.lengthComputable,
loaded: ev.loaded,
total: ev.total
}, e.origin);
});
s.xhr = function () {
return xhr;
};
if (!(s.data instanceof Blob)) {
f = new FormData();
$.each(s.data, function (i, v) {
f.append(v.name, v.value);
});
s.data = f;
}
$.ajax(s).always(function (result, statusText, jqXHR) {
if (!jqXHR.done) {
jqXHR = result;
result = null;
}
e.source.postMessage({
id: s.id,
status: jqXHR.status,
statusText: statusText,
result: result,
headers: jqXHR.getAllResponseHeaders()
}, e.origin);
});
});
</script>
</body>
</html>
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
MultipleFileUpload.rar (46个子文件)
MultipleFileUpload
MultipleFileUpload.sln 944B
MultipleFileUpload
css
jquery.fileupload-ui.css 2KB
bootstrap.css 115KB
bootstrap-image-gallery.min.css 2KB
bootstrap-ie6.min.css 568B
bootstrap-responsive.css 21KB
style.css 292B
handlers
Upload.ashx 107B
FileStatus.cs 2KB
FileComplete.ashx.cs 423B
FileError.ashx.cs 417B
FileError.ashx 113B
FileComplete.ashx 119B
Upload.ashx.cs 8KB
bin
Default.aspx 13KB
Web.config 639B
img
file-complete-icon.png 2KB
file-error-icon.png 3KB
glyphicons-halflings.png 12KB
glyphicons-halflings-white.png 9KB
loading.gif 4KB
obj
Web.Debug.config 1KB
Default.aspx.designer.cs 526B
js
jquery.min.js 109KB
jquery.fileupload.js 48KB
load-image.min.js 1KB
vendor
jquery.ui.widget.js 7KB
tmpl.min.js 1KB
html5.js 3KB
canvas-to-blob.min.js 1KB
locale.js 792B
bootstrap.min.js 25KB
jquery.fileupload-ui.js 29KB
cors
jquery.postmessage-transport.js 4KB
jquery.xdr-transport.js 3KB
bootstrap-image-gallery.min.js 7KB
jquery.fileupload-fp.js 8KB
jquery.iframe-transport.js 8KB
storage
Web.Release.config 1KB
cors
postmessage.html 2KB
result.html 537B
MultipleFileUpload.csproj.user 1KB
MultipleFileUpload.csproj 6KB
Properties
AssemblyInfo.cs 2KB
Default.aspx.cs 215B
MultipleFileUpload.suo 56KB
共 46 条
- 1
资源评论
- KsonJsy2014-12-16不会用,哎,技术不行
- vlliams2019-09-06可以,我做了测试,并且已经移植到了.NET CORE
- lucyjimmy2013-01-11很不错,可惜现在不会用,等好好研究一下JQUERY。
zhuwenlong2020
- 粉丝: 1
- 资源: 14
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功