加入收藏 | 设为首页 | 会员中心 | 我要投稿 湖南网 (https://www.hunanwang.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 创业 > 正文

JavaScript 工具先容及简朴行使要领

发布时间:2018-08-28 10:06:55 所属栏目:创业 来源:站长网
导读:Java Script 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说话可以让你自界说工具和变量范例。 ------------

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!

(编辑:湖南网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    热点阅读