WinJS.Class.define function
2013-02-20 14:45
393 查看
Applies to: Windows Store apps
only
Defines a class using the given constructor and the specified
instance members.
constructor
Type: Function
A constructor function that is used to instantiate this type.
instanceMembers
Type: Object
The set of instance fields, properties, and methods made available
on the type.
staticMembers
The set of static fields, properties, and methods made available on
the type.
Type: Object
The newly-defined type.
For more information about using this method,
see Defining
and deriving types with WinJS.Class. For information about
using constructors to define types in JavaScript,
see Using
Constructors to Define Types.
The following code shows how to use this method.
JavaScript
only
Defines a class using the given constructor and the specified
instance members.
Syntax
var object = WinJS.Class.define(constructor, instanceMembers, staticMembers);
Parameters
constructorType: Function
A constructor function that is used to instantiate this type.
instanceMembers
Type: Object
The set of instance fields, properties, and methods made available
on the type.
staticMembers
The set of static fields, properties, and methods made available on
the type.
Return value
Type: ObjectThe newly-defined type.
Remarks
For more information about using this method,see Defining
and deriving types with WinJS.Class. For information about
using constructors to define types in JavaScript,
see Using
Constructors to Define Types.
Examples
The following code shows how to use this method.JavaScript
var Robot = WinJS.Class.define( function(name) { this.name = name; }, { modelName: "" }, { harmsHumans: false }); var myRobot = new Robot("Mickey"); myRobot.modelName = "4500"; Robot.harmsHumans = false;
相关文章推荐
- WinJS.xhr function (Windows)
- Multi-Function Ntrip Software an…
- MATLAB中feval、class、'function_handle'、isa、strcmp的用法
- javascript  Function
- js 去掉nbsp; </br>
- JS 图片按比例缩小
- jsp嵌入flex swf 和flex调用js方法
- js 获取浏览器高度和宽度值(多浏览…
- win8: WinJS的面向对象 WinJS.Class
- ASP.NET 2.0: 页面中链入的CSS、js文件带中文时需注意
- js keyCode
- js 遍历对象
- javascript&nbsp;浅析&nbsp;对象&nbsp;function
- JS中URL编码与.net URL解码
- js中替换返回json中的空格为
- matlab错误:Function 'conv2' is not defined for values of class 'double' and attributes
- Win&nbsp;7&nbsp;Walk&nbsp;man&nbsp;nwz&nbsp;a844&nbsp;驱动
- js 获取单选框的值
- Win 7或者Vista的安装盘的制…
- js&nbsp;&nbsp;quality&nbsp;and&nbsp;so&nbsp;on&nbsp;......