jquery实现兼容IE8的异步上传文件
【jquery实现兼容IE8的异步上传文件】案例:
!DOCTYPE htmlhtml xmlns="http://www.w3.org/1999/xhtml"headmeta http-equiv="Content-Type" content="text/html; charset=utf-8" /title无标题文档/titlescript type="text/javascript" src="https://www.questions.com.cn/dnjc/jquery.min.js"/scriptscript src="https://www.questions.com.cn/dnjc/upload02.js"/scriptscript type="text/javascript"function look() {//alert($("form input[type=file]").val())alert($("input[name=test]").upload("getFileVal"))}function clean() {$("input[name=test]").upload("clean")}function ajaxSubmit() {$("input[name=test]").upload({url: ’index.aspx’,// 其他表单数据params: { name: ’pxblog’ },// 上传完成后, 返回json, textdataType: ’json’,onSend: function (obj, str) { return true; },// 上传之后回调onComplate: function (data) {alert(data.file);}});$("input[name=test]").upload("ajaxSubmit")}function look1() {//alert($("form input[type=file]").val())alert($("input[name=test1]").upload("getFileVal"))}function clean1() {$("input[name=test1]").upload("clean")}function ajaxSubmit1() {$("input[name=test1]").upload({url: ’index.aspx’,// 其他表单数据params: { name: ’pxblog’ },// 上传完成后, 返回json, textdataType: ’json’,onSend: function (obj, str) { return true; },// 上传之后回调onComplate: function (data) {alert(data.file);}});$("input[name=test1]").upload("ajaxSubmit")}/script/head bodypinput type="button" value="https://www.questions.com.cn/dnjc/look" onclick="look()" /input type="button" value="https://www.questions.com.cn/dnjc/clean" onclick="clean()" /input type="button" value="https://www.questions.com.cn/dnjc/ajaxSubmit" onclick="ajaxSubmit()" /input type="file" name="test" //ppinput type="button" value="https://www.questions.com.cn/dnjc/look1" onclick="look1()" /input type="button" value="https://www.questions.com.cn/dnjc/clean1" onclick="clean1()" /input type="button" value="https://www.questions.com.cn/dnjc/ajaxSubmit1" onclick="ajaxSubmit1()" /input type="file" name="test1" //p/body/html源码:http://code.taobao.org/p/upload2/src/jquery.upload2.js
我测试的环境是IE10,在IE10的开发者工具中模拟IE8 , 测试通过 。(我将浏览器的安全权限设置了中,应该没有多大关系)
修复了此人写的一些小错误,添加几个方法,主要是通过了IE8的测试(之前的不支持IE8) 。
以上所述就是本文的全部内容了 , 希望大家能够喜欢 。
您可能感兴趣的文章:Jquery插件之多图片异步上传jquery之ajaxfileupload异步上传插件(附工程代码)jquery的ajaxSubmit()异步上传图片并保存表单数据演示代码jquery uploadify和apache Fileupload实现异步上传文件示例使用jquery.upload.js实现异步上传示例代码jQuery插件ajaxFileUpload实现异步上传文件效果JQuery插件ajaxfileupload.js异步上传文件实例jQuery异步上传文件插件ajaxFileUpload详细介绍PHP结合jQuery插件ajaxFileUpload实现异步上传文件实例基于Jquery插件实现跨域异步上传文件功能
