jQuery Ajax 上传文件示例
来源:互联网 发布:linux网络命令详解 编辑:程序博客网 时间:2024/06/04 18:41
<html>
<head>
<script src="./jquery-1.2.6.js" type="text/javascript"></script>
<script src="./jquery.ajax_upload.0.9.min.js"" type="text/javascript"></script>
<script>
/*<![CDATA[*/
$(document).ready(function(){
new Ajax_upload('#example1_button', {
action: 'upload.php', //-处理页面
name: 'myfile', //-文件名
onSubmit: function(file, ext)
{
var allowed = ['avi', 'jpg', 'png', 'gif', 'jpeg']; //----允许格式(数组)
if ($.inArray(String(ext), allowed) === -1)
{
$('#example1_message').text('Error: only images are allowed');
return false;
}
$('#example1_message').text('Uploading……');
this.disable();
},
onComplete: function(file, response)
{
$('#example1_message').text(file + ' uploaded');
this.enable();
$('<li></li>').appendTo('#example1_files').text(file);
},
onerror: function(file, response)
{
$('#example1_message').text(response);
}
});
});
/*]]>*/
</script>
</head>
<body>
<div id="example1">
<p>You can allow only certain file types</p>
<div id="example1_wrapper">
<div id="example1_button">Upload</div>
</div>
<p id="example1_message"></p>
<UL id="example1_files"></UL>
</div>
</body>
</html>
- jQuery Ajax 上传文件示例
- jQuery AJAX 文件上传
- jquery ajax 文件上传
- jquery ajax上传文件
- ajax jquery 上传文件
- JQUERY AJAX上传文件
- jQuery ajax 文件上传
- JQuery ajax 上传文件
- jquery ajax上传文件
- Ajax上传文件 (JQuery Ajax&原生Ajax)
- jquery ajax 文件上传 收藏
- jQuery Ajax文件上传(php)
- jquery ajax文件上传问题
- jquery实现ajax文件上传
- struts1+ajax+jquery上传文件
- jquery AJAX 实现文件上传
- jQuery + Ajax + WebAPI 上传文件
- Ajax上传文件(JQuery篇)
- 再谈JavaScript中对象的prototype链
- 函式库管理:ldconfig 与 /etc/ld.so.conf 以及 ldd
- PHP连接各种数据库方法代码备忘
- C++字符串完全指引之二 —— 字符串封装类
- 无法加载DLL xx.dll的解决方案
- jQuery Ajax 上传文件示例
- 非知名猎头Henry 和你谈-高薪是怎么跳出来的
- 工具栏按钮与屏幕上的按钮,响应方式的区别
- C++ Inline ASM 内联汇编祥解
- CPS校园通信平台 系统架构说明
- 在ubuntu中安装IE6
- 一个好用的DBGRID
- 今早还算早
- 设置菜单条及菜单项背景色