基本信息
源码名称:AJAX不刷新批量传图
源码大小:0.12M
文件格式:.zip
开发语言:C#
更新时间:2016-04-20
友情提示:(无需注册或充值,赞助后即可获取资源下载链接)
嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300
本次赞助数额为: 2 元×
微信扫码支付:2 元
×
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
源码介绍
$(".width120").unbind("change");
$(".width120").change(function () {
var id = $(this).attr("id");
id = (id.split("-"))[1];
if ($("#hid-" id).val() == "false") {//文件不在上传状态
if ($("#file-" id).val() != "") {
$("#hid-" id).val("true")
$("#UpLoadForm-" id).ajaxSubmit({
success: function (html, status) {
var result = html.replace("<pre>", "");
result = result.replace("</pre>", "");
var img = (result.split(">"))[1];
$("#image-" id).attr('src', img);
$("#loding-" id).text("完成");
list = $(".file");
var isok = true;
for (var i = 0; i < list.length; i ) {
if (list[i].value == "") {
isok = false;
}
}
if (isok) {//添加新的控件
id ;
$("#new").append("<form id='UpLoadForm-" id "' name='UpLoadForm' method='post' enctype='multipart/form-data' action='Update.ashx'><table border='0' cellpadding='0' cellspacing='0' class='upp'><tr><td><input class='width120' type='file' id='file-" id "' name='flUpload' /><p style='display:inline;' id='loding-" id "'>未上传</p><input id='hid-" id "' type='hidden' value='false'><image style='display:inline;width:100px;height:50px;' id='image-" id "'/></div><br/></td></tr></table></form>");
add();
}
}
});
} else {
alert("请先选择文件!");
}
$(".width120").unbind("change");
$(".width120").change(function () {
var id = $(this).attr("id");
id = (id.split("-"))[1];
if ($("#hid-" id).val() == "false") {//文件不在上传状态
if ($("#file-" id).val() != "") {
$("#hid-" id).val("true")
$("#UpLoadForm-" id).ajaxSubmit({
success: function (html, status) {
var result = html.replace("<pre>", "");
result = result.replace("</pre>", "");
var img = (result.split(">"))[1];
$("#image-" id).attr('src', img);
$("#loding-" id).text("完成");
list = $(".file");
var isok = true;
for (var i = 0; i < list.length; i ) {
if (list[i].value == "") {
isok = false;
}
}
if (isok) {//添加新的控件
id ;
$("#new").append("<form id='UpLoadForm-" id "' name='UpLoadForm' method='post' enctype='multipart/form-data' action='Update.ashx'><table border='0' cellpadding='0' cellspacing='0' class='upp'><tr><td><input class='width120' type='file' id='file-" id "' name='flUpload' /><p style='display:inline;' id='loding-" id "'>未上传</p><input id='hid-" id "' type='hidden' value='false'><image style='display:inline;width:100px;height:50px;' id='image-" id "'/></div><br/></td></tr></table></form>");
add();
}
}
});
} else {
alert("请先选择文件!");
}