JS 对象介绍
来源:互联网 发布:linux google 五笔 编辑:程序博客网 时间:2024/04/30 14:00
JavaScript is an Object Oriented Programming (OOP) language.
JS是面向对象的编程语言(面向对象)。
An OOP language allows you to define your own objects and make your own variable types.
OOP语言可以让你自定义对象和变量类型。
--------------------------------------------------------------------------------
Object Oriented Programming
被安置对象的编程
JavaScript is an Object Oriented Programming (OOP) language. An OOP language allows you to define your own objects and make your own variable types.
JS是(OOP)语言,这就可以让你定义....(和上面的重复)
However, creating your own objects will be explained later, in the Advanced JavaScript section. We will start by looking at the built-in JavaScript objects, and how they are used. The next pages will explain each built-in JavaScript object in detail.
然而,我们将晚些在高级JS里介绍建立自定义对象。我们将开始观察内建JS对象和如何使用它们。下页将详细介绍每个内建JS对象
Note that an object is just a special kind of data. An object has properties and methods.
注意,对象只是特殊类型的数据。对象有属性和方法
--------------------------------------------------------------------------------
Properties
属性
Properties are the values associated with an object.
属性是对象的相连值
In the following example we are using the length property of the String object to return the number of characters in a string:
下面的例子我么使用了字符串对象的长度属性来返回字符的数量:
<script type="text/javascript">
var txt="Hello World!"
document.write(txt.length)
</script>
The output of the code above will be:
上面的代码就会输出:
12
--------------------------------------------------------------------------------
Methods
方法
Methods are the actions that can be performed on objects.
对象的方法可以执行行为。
In the following example we are using the toUpperCase() method of the String object to display a text in uppercase letters:
下面的例子使用了字符串对象的toUpperCase()方法来显示出文字的大写:
<script type="text/javascript">
var str="Hello world!"
document.write(str.toUpperCase())
</script>
The output of the code above will be:
上面的代码输出:
HELLO WORLD!
- JS 对象介绍
- JS 对象介绍
- JS 对象介绍
- js Blob对象介绍
- js-dom-document对象介绍
- JS 中Regexp对象介绍
- js面向对象方法介绍
- js中Math对象的介绍
- JS创建对象的模式介绍
- js创建对象的模式介绍
- js 内置对象--array常用属性介绍
- js event对象整理及详细介绍
- js对象 javascript 中的 e -- window.event 对象详细介绍
- 介绍一个辅助面向对象开发的js库
- js中内置对象Date的方法介绍
- JS window对象的top、parent、opener含义介绍
- JS获取html对象的几种方式介绍
- 原生js面向对象基本思想及介绍
- [HTML]显示/隐藏DIV的技巧(visibility与display的差别)
- 转文:财经书不是阿拉丁神灯
- 周一
- 温州出资培训“富二代” 每人补贴8800元
- PHP优化技巧一例
- JS 对象介绍
- 运用JS将搜索的关键字高亮显示
- 3.2.5 PHP类常量的局限
- ASP 内建对象
- 网店宣传秘籍!!!
- 程序员最痛苦的.......
- 谈谈线程及线程的几种状态
- openssh升级及配置操作步骤(转)
- Dev 控件的心得