Please contact me at cailongqun@yahoo.com.cn, if you need any website development.
This is a hacked version of Ajaxupload plugin created by, which is really good enought for normal use.
In this hacked version, it submits the specified file type of input element only, so we don't bother with extra form fields.
how to use it?
1. include jquery.js & ajaxfileupload.js javascript files
2. create a function to be fired when the upload button clicked.
e.g.
function ajaxFileUpload()
{
//starting setting some animation when the ajax starts and completes
$("#loading")
.ajaxStart(function(){
$(this).show();
})
.ajaxComplete(function(){
$(this).hide();
});
/*
prepareing ajax file upload
url: the url of script file handling the uploaded files
fileElementId: the file type of input element id and it will be the index of $_FILES Array()
dataType: it support json, xml
secureuri:use secure protocol
success: call back function when the ajax complete
error: callback function when the ajax failed
*/
$.ajaxFileUpload
(
{
url:'doajaxfileupload.php',
secureuri:false,
fileElementId:'fileToUpload',
dataType: 'json',
success: function (data, status)
{
if(typeof(data.error) != 'undefined')
{
if(data.error != '')
{
alert(data.error);
}else
{
alert(data.msg);
}
}
},
error: function (data, status, e)
{
alert(e);
}
}
)
return false;
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
ajax.rar (14个子文件)
ajax
ajaxfileupload_instructions.txt 2KB
upload.php 1KB
jquery.js 27KB
index.html.bak 858B
doajaxfileupload.php 2KB
change_notes.php 440B
ajaxfileupload.css 779B
form.php 315B
uploads
1376897684.jpg 38KB
upload.php.bak 1KB
doajaxfileupload.php.bak 2KB
ajaxfileupload.php 2KB
ajaxfileupload.js 7KB
loading.gif 4KB
共 14 条
- 1
资源评论
- phperno12015-01-29正是我需要的,很好·非常感谢
lz562065806
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功