jdownload的使用
2015-09-11 11:33
351 查看
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<link href="js/themes/base/jquery.ui.all.css" rel="stylesheet" />
<link href="js/jquery.jdownload.css" rel="stylesheet" />
</head>
<body>
<a title="title" id="download">点击预览下载</a>
<script src="js/jquery-1.9.1.js"></script>
<script src="js/ui/jquery-ui.js"></script>
<script src="js/jquery.jdownload.js"></script>
<script>
$(document).ready(function () {
$('#download').jDownload({
event: 'click',
dialogWidth: 200,
dialogHeight: 200,
filePath: "/file/test.zip"
});
});
</script>
</body>
</html
引用jquery和ui库,引用jquery.jdownload.js和样式。
参数说明
var config = {
root: "http://localhost:8080/",//你网站的地址。
filePath : null,
event : "click", // 默认是支持点击事件
dialogTitle : "文件下载",
dialogDesc : '点击下载',
dialogWidth : 200,
dialogHeight : 'auto',
dialogModal : true,
showfileInfo : true,
start : null,
stop : null,
download : null,
cancel : null
}
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<link href="js/themes/base/jquery.ui.all.css" rel="stylesheet" />
<link href="js/jquery.jdownload.css" rel="stylesheet" />
</head>
<body>
<a title="title" id="download">点击预览下载</a>
<script src="js/jquery-1.9.1.js"></script>
<script src="js/ui/jquery-ui.js"></script>
<script src="js/jquery.jdownload.js"></script>
<script>
$(document).ready(function () {
$('#download').jDownload({
event: 'click',
dialogWidth: 200,
dialogHeight: 200,
filePath: "/file/test.zip"
});
});
</script>
</body>
</html
引用jquery和ui库,引用jquery.jdownload.js和样式。
参数说明
var config = {
root: "http://localhost:8080/",//你网站的地址。
filePath : null,
event : "click", // 默认是支持点击事件
dialogTitle : "文件下载",
dialogDesc : '点击下载',
dialogWidth : 200,
dialogHeight : 'auto',
dialogModal : true,
showfileInfo : true,
start : null,
stop : null,
download : null,
cancel : null
}
相关文章推荐
- Jmeter 快速入门教程(二)--创建简单web测试
- 实际应用对短信平台有哪些要求
- 第二周项目3—体验复杂度
- iOS开发小白学习体验-7-网络请求
- 每天的学习经验:SharePoint 2013 定义自己添加的产品清单。Callout菜单项、文档关注、SharePoint服务机端对象模型查询
- python3.4.3 调用http接口 解析response xml后插入数据库
- 归并排序
- 常见程序入口点(OEP)特征
- 日经春秋 20150911
- Thread线程的方法用法,有代码例子,简单易懂
- iOS开发小白学习体验-6
- 天声人語 20150911
- LeetCode House Robber II
- 42 个移动端启动页面优化 Tips
- android布局
- Android开发一客户端与服务器交互(登陆功能)
- 洗衣机一边进水一边出水 更换排水阀皮碗
- LeetCode House Robber II
- 初次学习shader
- 表单获取焦点失去焦点