亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 2356 | 回復(fù): 0
打印 上一主題 下一主題

JS 對象介紹 [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2010-01-18 10:33 |只看該作者 |倒序瀏覽

JavaScript is an Object Oriented Programming (OOP) language.
JS是面向?qū)ο蟮木幊陶Z言(面向?qū)ο螅?br /> 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)語言,這就可以讓你定義....(和上面的重復(fù))
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里介紹建立自定義對象。我們將開始觀察內(nèi)建JS對象和如何使用它們。下頁將詳細(xì)介紹每個內(nèi)建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ù)量:
var txt="Hello World!"
document.write(txt.length)
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()方法來顯示出文字的大寫:
var str="Hello world!"
document.write(str.toUpperCase())
The output of the code above will be:
上面的代碼輸出:
HELLO WORLD!

本文來自ChinaUnix博客,如果查看原文請點:http://blog.chinaunix.net/u3/110516/showart_2151792.html
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP