javascript object oriented 面向?qū)ο缶幊坛醪?/h1>
更新時(shí)間:2007年01月10日 00:00:00 作者:
用 new Object() 來(lái)創(chuàng)建對(duì)象
在javascript里有幾種創(chuàng)建對(duì)象的方法,在不同的場(chǎng)合可用不同的方法.最簡(jiǎn)單的就是用 new 操作符,例如:
復(fù)制代碼 代碼如下:<script language="javascript" type="text/javascript">
<!--
person = new Object()
person.name = "Tim Scarfe"
person.height = "6Ft"
person.run = function() {
this.state = "running"
this.speed = "4ms^-1"
}
//-->
</script>
我們?cè)谶@個(gè)例子里定義了person這個(gè)對(duì)象,然后加入了它的屬性和方法.在這個(gè)例子里,自定義的方法里有兩個(gè)屬性.
用文字記號(hào)Literal Notation創(chuàng)建對(duì)象
用文字記號(hào)也可以創(chuàng)建對(duì)象,但要javascript 1.2以上版本.它的創(chuàng)建形式是多樣的.
復(fù)制代碼 代碼如下:<script language="javascript" type="text/javascript">
<!--
// Object Literals
timObject = {
property1 : "Hello",
property2 : "MmmMMm",
property3 : ["mmm", 2, 3, 6, "kkk"],
method1 : function(){alert("Method had been called" + this.property1)}
};
timObject.method1();
alert(timObject.property3[2]) // will yield 3
var circle = { x : 0, y : 0, radius: 2 } // another example
// nesting is no problem.
var rectangle = {
upperLeft : { x : 2, y : 2 },
lowerRight : { x : 4, y : 4}
}
alert(rectangle.upperLeft.x) // will yield 2
//-->
</script>
文字記號(hào)可是是數(shù)組,也可以是任意的javascript表達(dá)式或值.
用 new 操作符或文字記號(hào)創(chuàng)建一個(gè)自定義對(duì)象都是簡(jiǎn)單的,也是符合邏輯的.但它最大的缺點(diǎn)就是結(jié)果不可復(fù)用.也不能很容易的用不同的版本初始化創(chuàng)建對(duì)象.例如上面 的第一個(gè)例子,如果 person 的 name 不是 "Tim Scarfe",那樣我們不得不重新定義整個(gè)對(duì)象,僅僅為了適應(yīng)它的一點(diǎn)點(diǎn)改變.
對(duì)象的構(gòu)造和原型
在OOP的世界里,用先前的方法定義對(duì)象在許多場(chǎng)合都有限制.我們需要一種創(chuàng)建對(duì)象的方法,類(lèi)型可以被多次使用而不用重新定義.對(duì)象在實(shí)例化時(shí)每次都可以按需分配不同的值.實(shí)現(xiàn)這個(gè)目標(biāo)的標(biāo)準(zhǔn)方法是用對(duì)象構(gòu)造器函數(shù).
一個(gè)對(duì)象構(gòu)造器只不過(guò)是個(gè)有規(guī)則的javascript函數(shù),它就象一個(gè)容器(定義參數(shù),調(diào)用其他函數(shù)等等).它們兩者所不同的是構(gòu)造器函數(shù)是由 new 操作符調(diào)用的.(你將在下面的例子中看到).基于函數(shù)語(yǔ)法形式的對(duì)象定義,我們可以使它工作得最好.
讓我們用現(xiàn)實(shí)世界中的貓來(lái)舉個(gè)例子.貓的 name 和 color 是貓的屬性.meeyow(貓叫)是它的一個(gè)方法.重要的是任何不同的貓都可能有不同的 name 和 meeyow 的叫聲.為了建立適應(yīng)這些特征的對(duì)象類(lèi),我們將使用對(duì)象構(gòu)造器.
復(fù)制代碼 代碼如下:<script language="javascript" type="text/javascript">
<!--
function cat(name) {
this.name = name;
this.talk = function() {
alert( this.name + " say meeow!" )
}
}
cat1 = new cat("felix")
cat1.talk() //alerts "felix says meeow!"
cat2 = new cat("ginger")
cat2.talk() //alerts "ginger says meeow!"
//-->
</script>
在這里,函數(shù) cat() 是一個(gè)對(duì)象構(gòu)造器,它的屬性和方法在函數(shù)體里用this來(lái)定義,用對(duì)象構(gòu)造器定義的對(duì)象用 new 來(lái)實(shí)例化.主意我們?nèi)绾畏浅H菀椎亩x多個(gè)cat 的實(shí)例.每一個(gè)都有自己的名字,這就是對(duì)象構(gòu)造器帶給我們的靈活性.
構(gòu)造器建立了對(duì)象的藍(lán)圖.并不是對(duì)象本身.
在原型里增加方法.
在上面我們看到的例子里,對(duì)象的方法是在構(gòu)造器里定義好的了.另外一種實(shí)現(xiàn)的途徑是通過(guò)原型(prototype).xxx
原型是javascript繼承的一種形式.我們可以為對(duì)象定義好后,再創(chuàng)造一個(gè)方法.原來(lái)所有對(duì)象的實(shí)例都將共享.
讓我們來(lái)擴(kuò)展最初的 cat 對(duì)象.增加一個(gè)改名的方法.用 prototype 的方式.
復(fù)制代碼 代碼如下:<script language="javascript" type="text/javascript">
<!--
cat.prototype.changeName = function(name) {
this.name = name;
}
firstCat = new cat("pursur")
firstCat.changeName("Bill")
firstCat.talk() //alerts "Bill says meeow!"
//-->
</script>
就象你所看到的.我們僅只用了 關(guān)鍵字 prototype 實(shí)現(xiàn)了在對(duì)象定義后馬上增加了changeName方法.這個(gè)方法被所有的實(shí)例共享.
用原型(prototype) 重載 javascript 對(duì)象
原型 在自定義對(duì)象和有選擇性的重載對(duì)象上都可以工作.比如 Date() 或 String 這可能是無(wú)止境的.
子類(lèi)和超類(lèi)
在JAVA 和C++里,有關(guān)于類(lèi)層次的外在概念.每一個(gè)類(lèi)能有一個(gè)角色.
In Java and C++, there is an explicit concept of the class hierarchy. i.e. Every class can have a super class from which it inherits properties and methods. Any class can be extended, or sub-classed so the resulting subclass can inherit its parent's behavior. As we have seen, javascript supports prototype inheritance instead of class based. It's possible for inheritance to happen other ways, however.
The following is an example of inheritance through functions.
下面一個(gè)例子演示了如何繼承通過(guò)function .
復(fù)制代碼 代碼如下:<script language="javascript" type="text/javascript">
<!--
// thanks to webreference
function superClass() {
this.supertest = superTest; //attach method superTest
}
function subClass() {
this.inheritFrom = superClass;
this.inheritFrom();
this.subtest = subTest; //attach method subTest
}
function superTest() {
return "superTest";
}
function subTest() {
return "subTest";
}
var newClass = new subClass();
alert(newClass.subtest()); // yields "subTest"
alert(newClass.supertest()); // yields "superTest"
//-->
</script>
基于繼承的原型是遙遠(yuǎn)的.為 javascript 應(yīng)用程序在許多場(chǎng)合.
(基于原型的繼承在許多javascript的應(yīng)用場(chǎng)合是非常有用的.)
對(duì)象作為聯(lián)合數(shù)組
正如你所知, (.)操作符能夠用來(lái)存儲(chǔ).[] 操作符用來(lái)操作數(shù)組.
<script language="javascript" type="text/javascript">
<!--
// These are the same
object.property
object["property"]
//-->
</script>
<SCRIPT LANGUAGE="javascript">
<!--
function Circle (xPoint, yPoint, radius) {
this.x = xPoint;
this.y = yPoint;
this.r = radius;
}
var aCircle = new Circle(5, 11, 99);
alert(aCircle.x);
alert(aCircle["x"]);
//-->
</SCRIPT>
How do I loop through properties in an object?
You need to use a for/in loop.
我們可以通過(guò)for in循環(huán)來(lái)遍歷對(duì)象的屬性。
<script language="javascript" type="text/javascript">
<!--
var testObj = {
prop1 : "hello",
prop2 : "hello2",
prop3 : new Array("hello",1,2)
}
for(x in testObj) alert( x + "-" + testObj[ x ] )
//-->
</script>
<SCRIPT LANGUAGE="javascript">
<!--
var Circle = { x : 0, y : 1, radius: 2 } // another example
for(p in Circle)
alert( p + "-" + Circle[ p ] )
//-->
</SCRIPT>
The important thing to notice is that in the object syntax the property is an identifier, whereas in the array syntax, it's a string. The obvious benefits of using an array syntax to access an object is because of the literal data type, you can easily concat strings and play around with them to access an object. For this to work with the standard syntax, an eval() would need to be used.
應(yīng)該值得注意的是對(duì)象的屬性只是一個(gè)標(biāo)識(shí)字符,盡管在一個(gè)數(shù)組里是一個(gè)字符串,因?yàn)槭且粋€(gè)literal的數(shù)據(jù)類(lèi)型,所以有利于使用數(shù)組的方式的操作一個(gè)對(duì)象。你也可以很容易的存取一個(gè)對(duì)象在標(biāo)準(zhǔn)的語(yǔ)句中。這個(gè)時(shí)候eval()函數(shù)可能用得到。
<script language="javascript" type="text/javascript">
<!--
testObj = {
prop1 : "hello",
prop2 : "hello2",
prop3 : new Array("helloa",1,2)
}
for(x in testObj) alert( x + "-" + testObj[ x ] )
var prop3 = testObj["prop3"];
alert(prop3);
//alert(prop[1]);
alert(typeof(prop3));
alert(eval(prop3)[1]);
alert(typeof(eval(prop3)[1]));
//-->
</script>
網(wǎng)上的東西錯(cuò)誤的太多了,jb51.net修正后的測(cè)試下
[Ctrl+A 全選 注:引入外部Js需再刷新一下頁(yè)面才能執(zhí)行]
您可能感興趣的文章:- js如何打印object對(duì)象
- JavaScript 判斷判斷某個(gè)對(duì)象是Object還是一個(gè)Array
- js中判斷Object、Array、Function等引用類(lèi)型對(duì)象是否相等
- Javascript創(chuàng)建自定義對(duì)象 創(chuàng)建Object實(shí)例添加屬性和方法
- Nodejs學(xué)習(xí)筆記之Global Objects全局對(duì)象
- Javascript中判斷變量是數(shù)組還是對(duì)象(array還是object)
- Javascript 面向?qū)ο?對(duì)象(Object)
- js Object2String方便查看js對(duì)象內(nèi)容
- javascript 對(duì)象數(shù)組根據(jù)對(duì)象object key的值排序
- 淺析JavaScript中的對(duì)象類(lèi)型Object
相關(guān)文章
-
JavaScript中的this,call,apply使用及區(qū)別詳解
本文結(jié)合基本javascript的權(quán)威書(shū)籍中的內(nèi)容,根據(jù)自己的理解,通過(guò)相關(guān)示例向大家展示了javascript中this,call,apply使用及區(qū)別,非常的細(xì)致全面,希望大家能夠喜歡。 2016-01-01
-
你必須知道的JavaScript 中字符串連接的性能的一些問(wèn)題
每種程序語(yǔ)言中都會(huì)涉及到字符竄連接,而這個(gè)小小的字符竄連接問(wèn)題很可能會(huì)影響到系統(tǒng)的整體性能,本文主要探討JavaScript中字符串連接的性能問(wèn)題 2013-05-05
-
javascript向flash swf文件傳遞參數(shù)值注意細(xì)節(jié)
如何使用javascript向SWF文件傳遞參數(shù)?在網(wǎng)上找了一個(gè)完整的教程,很有啟發(fā)性和實(shí)用性,如下是完整實(shí)現(xiàn)的步驟,需要的朋友可以參考下 2012-12-12
-
淺析offsetLeft,Left,clientLeft之間的區(qū)別
這篇文章主要是對(duì)offsetLeft,Left,clientLeft之間的區(qū)別進(jìn)行了詳細(xì)的分析介紹,需要的朋友可以過(guò)來(lái)參考下想,希望對(duì)大家有所幫助 2013-11-11
最新評(píng)論
在javascript里有幾種創(chuàng)建對(duì)象的方法,在不同的場(chǎng)合可用不同的方法.最簡(jiǎn)單的就是用 new 操作符,例如:
復(fù)制代碼 代碼如下:
<script language="javascript" type="text/javascript">
<!--
person = new Object()
person.name = "Tim Scarfe"
person.height = "6Ft"
person.run = function() {
this.state = "running"
this.speed = "4ms^-1"
}
//-->
</script>
<!--
person = new Object()
person.name = "Tim Scarfe"
person.height = "6Ft"
person.run = function() {
this.state = "running"
this.speed = "4ms^-1"
}
//-->
</script>
我們?cè)谶@個(gè)例子里定義了person這個(gè)對(duì)象,然后加入了它的屬性和方法.在這個(gè)例子里,自定義的方法里有兩個(gè)屬性.
用文字記號(hào)Literal Notation創(chuàng)建對(duì)象
用文字記號(hào)也可以創(chuàng)建對(duì)象,但要javascript 1.2以上版本.它的創(chuàng)建形式是多樣的.
復(fù)制代碼 代碼如下:
<script language="javascript" type="text/javascript">
<!--
// Object Literals
timObject = {
property1 : "Hello",
property2 : "MmmMMm",
property3 : ["mmm", 2, 3, 6, "kkk"],
method1 : function(){alert("Method had been called" + this.property1)}
};
timObject.method1();
alert(timObject.property3[2]) // will yield 3
var circle = { x : 0, y : 0, radius: 2 } // another example
// nesting is no problem.
var rectangle = {
upperLeft : { x : 2, y : 2 },
lowerRight : { x : 4, y : 4}
}
alert(rectangle.upperLeft.x) // will yield 2
//-->
</script>
<!--
// Object Literals
timObject = {
property1 : "Hello",
property2 : "MmmMMm",
property3 : ["mmm", 2, 3, 6, "kkk"],
method1 : function(){alert("Method had been called" + this.property1)}
};
timObject.method1();
alert(timObject.property3[2]) // will yield 3
var circle = { x : 0, y : 0, radius: 2 } // another example
// nesting is no problem.
var rectangle = {
upperLeft : { x : 2, y : 2 },
lowerRight : { x : 4, y : 4}
}
alert(rectangle.upperLeft.x) // will yield 2
//-->
</script>
文字記號(hào)可是是數(shù)組,也可以是任意的javascript表達(dá)式或值.
用 new 操作符或文字記號(hào)創(chuàng)建一個(gè)自定義對(duì)象都是簡(jiǎn)單的,也是符合邏輯的.但它最大的缺點(diǎn)就是結(jié)果不可復(fù)用.也不能很容易的用不同的版本初始化創(chuàng)建對(duì)象.例如上面 的第一個(gè)例子,如果 person 的 name 不是 "Tim Scarfe",那樣我們不得不重新定義整個(gè)對(duì)象,僅僅為了適應(yīng)它的一點(diǎn)點(diǎn)改變.
對(duì)象的構(gòu)造和原型
在OOP的世界里,用先前的方法定義對(duì)象在許多場(chǎng)合都有限制.我們需要一種創(chuàng)建對(duì)象的方法,類(lèi)型可以被多次使用而不用重新定義.對(duì)象在實(shí)例化時(shí)每次都可以按需分配不同的值.實(shí)現(xiàn)這個(gè)目標(biāo)的標(biāo)準(zhǔn)方法是用對(duì)象構(gòu)造器函數(shù).
一個(gè)對(duì)象構(gòu)造器只不過(guò)是個(gè)有規(guī)則的javascript函數(shù),它就象一個(gè)容器(定義參數(shù),調(diào)用其他函數(shù)等等).它們兩者所不同的是構(gòu)造器函數(shù)是由 new 操作符調(diào)用的.(你將在下面的例子中看到).基于函數(shù)語(yǔ)法形式的對(duì)象定義,我們可以使它工作得最好.
讓我們用現(xiàn)實(shí)世界中的貓來(lái)舉個(gè)例子.貓的 name 和 color 是貓的屬性.meeyow(貓叫)是它的一個(gè)方法.重要的是任何不同的貓都可能有不同的 name 和 meeyow 的叫聲.為了建立適應(yīng)這些特征的對(duì)象類(lèi),我們將使用對(duì)象構(gòu)造器.
復(fù)制代碼 代碼如下:
<script language="javascript" type="text/javascript">
<!--
function cat(name) {
this.name = name;
this.talk = function() {
alert( this.name + " say meeow!" )
}
}
cat1 = new cat("felix")
cat1.talk() //alerts "felix says meeow!"
cat2 = new cat("ginger")
cat2.talk() //alerts "ginger says meeow!"
//-->
</script>
<!--
function cat(name) {
this.name = name;
this.talk = function() {
alert( this.name + " say meeow!" )
}
}
cat1 = new cat("felix")
cat1.talk() //alerts "felix says meeow!"
cat2 = new cat("ginger")
cat2.talk() //alerts "ginger says meeow!"
//-->
</script>
在這里,函數(shù) cat() 是一個(gè)對(duì)象構(gòu)造器,它的屬性和方法在函數(shù)體里用this來(lái)定義,用對(duì)象構(gòu)造器定義的對(duì)象用 new 來(lái)實(shí)例化.主意我們?nèi)绾畏浅H菀椎亩x多個(gè)cat 的實(shí)例.每一個(gè)都有自己的名字,這就是對(duì)象構(gòu)造器帶給我們的靈活性.
構(gòu)造器建立了對(duì)象的藍(lán)圖.并不是對(duì)象本身.
在原型里增加方法.
在上面我們看到的例子里,對(duì)象的方法是在構(gòu)造器里定義好的了.另外一種實(shí)現(xiàn)的途徑是通過(guò)原型(prototype).xxx
原型是javascript繼承的一種形式.我們可以為對(duì)象定義好后,再創(chuàng)造一個(gè)方法.原來(lái)所有對(duì)象的實(shí)例都將共享.
讓我們來(lái)擴(kuò)展最初的 cat 對(duì)象.增加一個(gè)改名的方法.用 prototype 的方式.
復(fù)制代碼 代碼如下:
<script language="javascript" type="text/javascript">
<!--
cat.prototype.changeName = function(name) {
this.name = name;
}
firstCat = new cat("pursur")
firstCat.changeName("Bill")
firstCat.talk() //alerts "Bill says meeow!"
//-->
</script>
<!--
cat.prototype.changeName = function(name) {
this.name = name;
}
firstCat = new cat("pursur")
firstCat.changeName("Bill")
firstCat.talk() //alerts "Bill says meeow!"
//-->
</script>
就象你所看到的.我們僅只用了 關(guān)鍵字 prototype 實(shí)現(xiàn)了在對(duì)象定義后馬上增加了changeName方法.這個(gè)方法被所有的實(shí)例共享.
用原型(prototype) 重載 javascript 對(duì)象
原型 在自定義對(duì)象和有選擇性的重載對(duì)象上都可以工作.比如 Date() 或 String 這可能是無(wú)止境的.
子類(lèi)和超類(lèi)
在JAVA 和C++里,有關(guān)于類(lèi)層次的外在概念.每一個(gè)類(lèi)能有一個(gè)角色.
In Java and C++, there is an explicit concept of the class hierarchy. i.e. Every class can have a super class from which it inherits properties and methods. Any class can be extended, or sub-classed so the resulting subclass can inherit its parent's behavior. As we have seen, javascript supports prototype inheritance instead of class based. It's possible for inheritance to happen other ways, however.
The following is an example of inheritance through functions.
下面一個(gè)例子演示了如何繼承通過(guò)function .
復(fù)制代碼 代碼如下:
<script language="javascript" type="text/javascript">
<!--
// thanks to webreference
function superClass() {
this.supertest = superTest; //attach method superTest
}
function subClass() {
this.inheritFrom = superClass;
this.inheritFrom();
this.subtest = subTest; //attach method subTest
}
function superTest() {
return "superTest";
}
function subTest() {
return "subTest";
}
var newClass = new subClass();
alert(newClass.subtest()); // yields "subTest"
alert(newClass.supertest()); // yields "superTest"
//-->
</script>
<!--
// thanks to webreference
function superClass() {
this.supertest = superTest; //attach method superTest
}
function subClass() {
this.inheritFrom = superClass;
this.inheritFrom();
this.subtest = subTest; //attach method subTest
}
function superTest() {
return "superTest";
}
function subTest() {
return "subTest";
}
var newClass = new subClass();
alert(newClass.subtest()); // yields "subTest"
alert(newClass.supertest()); // yields "superTest"
//-->
</script>
基于繼承的原型是遙遠(yuǎn)的.為 javascript 應(yīng)用程序在許多場(chǎng)合.
(基于原型的繼承在許多javascript的應(yīng)用場(chǎng)合是非常有用的.)
對(duì)象作為聯(lián)合數(shù)組
正如你所知, (.)操作符能夠用來(lái)存儲(chǔ).[] 操作符用來(lái)操作數(shù)組.
<script language="javascript" type="text/javascript">
<!--
// These are the same
object.property
object["property"]
//-->
</script>
<SCRIPT LANGUAGE="javascript">
<!--
function Circle (xPoint, yPoint, radius) {
this.x = xPoint;
this.y = yPoint;
this.r = radius;
}
var aCircle = new Circle(5, 11, 99);
alert(aCircle.x);
alert(aCircle["x"]);
//-->
</SCRIPT>
How do I loop through properties in an object?
You need to use a for/in loop.
我們可以通過(guò)for in循環(huán)來(lái)遍歷對(duì)象的屬性。
<script language="javascript" type="text/javascript">
<!--
var testObj = {
prop1 : "hello",
prop2 : "hello2",
prop3 : new Array("hello",1,2)
}
for(x in testObj) alert( x + "-" + testObj[ x ] )
//-->
</script>
<SCRIPT LANGUAGE="javascript">
<!--
var Circle = { x : 0, y : 1, radius: 2 } // another example
for(p in Circle)
alert( p + "-" + Circle[ p ] )
//-->
</SCRIPT>
The important thing to notice is that in the object syntax the property is an identifier, whereas in the array syntax, it's a string. The obvious benefits of using an array syntax to access an object is because of the literal data type, you can easily concat strings and play around with them to access an object. For this to work with the standard syntax, an eval() would need to be used.
應(yīng)該值得注意的是對(duì)象的屬性只是一個(gè)標(biāo)識(shí)字符,盡管在一個(gè)數(shù)組里是一個(gè)字符串,因?yàn)槭且粋€(gè)literal的數(shù)據(jù)類(lèi)型,所以有利于使用數(shù)組的方式的操作一個(gè)對(duì)象。你也可以很容易的存取一個(gè)對(duì)象在標(biāo)準(zhǔn)的語(yǔ)句中。這個(gè)時(shí)候eval()函數(shù)可能用得到。
<script language="javascript" type="text/javascript">
<!--
testObj = {
prop1 : "hello",
prop2 : "hello2",
prop3 : new Array("helloa",1,2)
}
for(x in testObj) alert( x + "-" + testObj[ x ] )
var prop3 = testObj["prop3"];
alert(prop3);
//alert(prop[1]);
alert(typeof(prop3));
alert(eval(prop3)[1]);
alert(typeof(eval(prop3)[1]));
//-->
</script>
網(wǎng)上的東西錯(cuò)誤的太多了,jb51.net修正后的測(cè)試下
[Ctrl+A 全選 注:引入外部Js需再刷新一下頁(yè)面才能執(zhí)行]
您可能感興趣的文章:
- js如何打印object對(duì)象
- JavaScript 判斷判斷某個(gè)對(duì)象是Object還是一個(gè)Array
- js中判斷Object、Array、Function等引用類(lèi)型對(duì)象是否相等
- Javascript創(chuàng)建自定義對(duì)象 創(chuàng)建Object實(shí)例添加屬性和方法
- Nodejs學(xué)習(xí)筆記之Global Objects全局對(duì)象
- Javascript中判斷變量是數(shù)組還是對(duì)象(array還是object)
- Javascript 面向?qū)ο?對(duì)象(Object)
- js Object2String方便查看js對(duì)象內(nèi)容
- javascript 對(duì)象數(shù)組根據(jù)對(duì)象object key的值排序
- 淺析JavaScript中的對(duì)象類(lèi)型Object
相關(guān)文章
JavaScript中的this,call,apply使用及區(qū)別詳解
本文結(jié)合基本javascript的權(quán)威書(shū)籍中的內(nèi)容,根據(jù)自己的理解,通過(guò)相關(guān)示例向大家展示了javascript中this,call,apply使用及區(qū)別,非常的細(xì)致全面,希望大家能夠喜歡。2016-01-01你必須知道的JavaScript 中字符串連接的性能的一些問(wèn)題
每種程序語(yǔ)言中都會(huì)涉及到字符竄連接,而這個(gè)小小的字符竄連接問(wèn)題很可能會(huì)影響到系統(tǒng)的整體性能,本文主要探討JavaScript中字符串連接的性能問(wèn)題2013-05-05javascript向flash swf文件傳遞參數(shù)值注意細(xì)節(jié)
如何使用javascript向SWF文件傳遞參數(shù)?在網(wǎng)上找了一個(gè)完整的教程,很有啟發(fā)性和實(shí)用性,如下是完整實(shí)現(xiàn)的步驟,需要的朋友可以參考下2012-12-12淺析offsetLeft,Left,clientLeft之間的區(qū)別
這篇文章主要是對(duì)offsetLeft,Left,clientLeft之間的區(qū)別進(jìn)行了詳細(xì)的分析介紹,需要的朋友可以過(guò)來(lái)參考下想,希望對(duì)大家有所幫助2013-11-11