<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Backbone Demo</title>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="underscore-1.1.6.js"></script>
<script type="text/javascript" src="backbone.js"></script>
<script type="text/javascript" src="backbone-localstorage.js"></script>
<script type="text/javascript" src="app.js"></script>
<style>
html,body{
height: 100%;
width : 100%;
margin: 0;
padding: 0;
font-size: 12px;
}
input.username{
width : 80px;
}
input.age{
width : 30px;
}
select.sex{
width : 45px;
}
.emp-table{
width: 100%;
text-align: center;
}
.emp-table tr{
height: 30px;
}
.emp-table td .edit{
display: none;
}
.emp-table td.editing .edit{
display: block;
}
.emp-table td.editing .display{
display: none;
}
</style>
</head>
<body>
<div style="width: 650px;margin: 0 auto;" id="app">
<p id="emp-form">
<label for="username">姓名:</label>
<input id="username" class="username" name="username"/>
<label for="sex">性别:</label>
<select id="sex" name="sex" class="sex">
<option value="0">男</option>
<option value="1">女</option>
</select>
<label for="age">年龄:</label>
<input id="age" name="age" class="age"/>
<label for="position">职位:</label>
<input id="position" name="position" class="position" />
<button id="add-btn">增加</button>
</p>
<table class="emp-table" border="1" cellspacing="0" cellpadding="0">
<caption style="font-size: 14px;font-weight: bold;">职员信息表(双击编辑)</caption>
<thead>
<tr>
<th>ID</th>
<th>姓名</th>
<th>性别</th>
<th>年龄</th>
<th>职位</th>
<th>操作</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<div id="pager"></div>
<script type="text/template" id="item-template">
<td><%= eid %></td>
<td class="username"><div class="display"><%= username %></div><div class="edit"><input class="username" name="username"></input></div></td>
<td class="sex"><div class="display"><%= sex=="1" ? "女":"男" %></div><div class="edit"><select name="sex" class="sex" style="width:45px"><option value="0">男</option><option value="1">女</option></select></div></td>
<td class="age"><div class="display"><%= age %></div><div class="edit"><input class="age" name="age"></input></div></td>
<td class="position"><div class="display"><%= position %></div><div class="edit"><input class="position" name="position"></input></div></td>
<td><a href="#" class="del">删除</a></td>
</script>
</div>
</body>
</html>
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
backbone不是脊椎骨,而是帮助开发重量级的javascript应用的框架。 主要提供了3个东西:1、models(模型) 2、collections(集合) 3、views(视图) backbone.js文件本身很小,压缩后只有5.3KB,作为一个框架级别的核心JS文件,这个数字很可怕。 除此之外,这个JS还必须依赖于另一个JS文件:underscore.js(包含许多工具方法,集合操作,js模板等等)。
资源推荐
资源详情
资源评论
收起资源包目录
backbone.zip (6个子文件)
jquery.js 241KB
backbone-localstorage.js 2KB
backbone.js 42KB
app.js 3KB
underscore-1.1.6.js 27KB
app1.html 3KB
共 6 条
- 1
init
- 粉丝: 1
- 资源: 7
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
- 5
前往页