最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

JS 對象介紹

 更新時間:2010年01月20日 00:58:42   作者:  
JS 對象介紹,需要的朋友可以參考下。

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.
注意,對象只是特殊類型的數(shù)據(jù)。對象有屬性和方法

--------------------------------------------------------------------------------
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:
下面的例子我么使用了字符串對象的長度屬性來返回字符的數(shù)量:
<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.
對象的方法可以執(zhí)行行為。
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!

相關文章

最新評論

香港 | 滦南县| 巴塘县| 宽甸| 壤塘县| 广丰县| 安西县| 大宁县| 浏阳市| 阳曲县| 呼和浩特市| 府谷县| 嵊泗县| 来凤县| 封丘县| 都昌县| 绥滨县| 通河县| 石景山区| 故城县| 湟源县| 全南县| 阜南县| 海林市| 贺兰县| 即墨市| 太谷县| 达孜县| 和龙市| 清水县| 寿光市| 常宁市| 兴安盟| 桂林市| 长阳| 宝清县| 辽阳县| 邓州市| 丁青县| 兴国县| 南溪县|