本文概述
- 参数说明
句法:
model.unset(attribute)
参数说明属性:它定义了所创建模型的属性。
让我们举个例子。
请参阅以下示例:
<
!DOCTYPE html>
<
head>
<
title> UnsetExample<
/title>
<
script src="http://img.readke.com/220416/0159505164-0.jpg" type="text/javascript"><
/script>
<
script src="http://img.readke.com/220416/01595055I-1.jpg" type="text/javascript"><
/script>
<
script src="http://img.readke.com/220416/0159506196-2.jpg" type="text/javascript"><
/script>
<
script type="text/javascript">
varCompany = Backbone.Model.extend();
var company=new Company();
company.set({ comp_name: "SSSIT.Org"});
document.write("<
b>Before using unset method , Company name is:<
/b> ", company.get('comp_name'));
company.unset('comp_name');
document.write("<
br>");
document.write("<
b>After unset, Company name is:<
/b>", company.get('comp_name'));
<
/script>
<
/head>
<
/html>
【backbone.js模型unset】输出:
文章图片
推荐阅读
- backbone.js模型has
- backbone.js模型escape
- backbone.js trigger事件
- backbone.js模型set
- backbone.js模型get
- backbone.js模型扩展
- backbone.js模型初始化
- backbone.js模型教程
- backbone.js listentoonce事件