Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

JavaScript ¹¹½¨ÀàºÍ´´½¨¶ÔÏóµÄ·½Ê½

1>¹¤³§º¯ÊýÀ´´´½¨¶ÔÏó(Factory)
     function createCar(){
var obj = new Object;
obj.name = "BWM";
obj.show = function(){
alert(this.name);
}
return obj;
}
var car1 = createCar();
var car2 = createCar();
car1.show();
car2.show();
2>¹¹Ô캯Êý´´½¨¶ÔÏó(Constructor)
     function Car(name){
this.name = name;
this.show = function(){
alert(this.name);
}
}
Car.prototype.say = function(){
alert("hello");
}
var car = new Car("BMW");
car.show();
car.say();
3>Ô­ÐÍ£¨prototype£©´´½¨¶ÔÏó
      function Car(){}
Car.prototype.name = "BMW";
Car.prototype.show = function(){
alert(this.name);
}
Car.prototype.say = function(){
alert("Hiloo");
}
var car = new Car();
car.show(); car.say();
4>¹¹Ôì && Ô­ÐÍ£ºÍƼöʹÓ㬵«ÊÇÀí½âÆðÀ´ÓеãÄ£ºý
     /*
¹¹Ô캯ÊýÊÇÀ´³õʼ»¯·Çº¯ÊýÊôÐÔµÄ
*/
function Car(name){
this.name = name;
}
Car.prototype.show = function(){
alert(this.name);
}
Car.prototype.say = function(){
alert("hiloo");
}
var car = new Car("BMW");
car.show(); car.say();
5>Dynamic Prototype£ºÀàËÆÓÚjavaÖÐÀàµÄ´´½¨£¬ÊÇѧϰ¹ýJavaÓïÑÔ³ÌÐòÔ±³£Óõķ½Ê½
    function Car(name){
this.name = name;
if(typeof Car._initialized == "undefined"){
Car.prototype.show = function(){
alert(this.name);
}
Car._initialized = true;//¸Ä±äÄ¿µÄÊÇ£¬Ö´ÐÐÒ»´Î
}
}
var car = new Car("BMW");
car.show();


Ïà¹ØÎĵµ£º

Javascript²Ù×÷select¿Ø¼þ´óÈ«

1ÅжÏselectÑ¡ÏîÖРÊÇ·ñ´æÔÚValue="paraValue"µÄItem 
 2ÏòselectÑ¡ÏîÖР¼ÓÈëÒ»¸öItem 
 3´ÓselectÑ¡ÏîÖРɾ³ýÒ»¸öItem 
 4ɾ³ýselectÖÐÑ¡ÖеÄÏî 
 5ÐÞ¸ÄselectÑ¡ÏîÖРvalue="paraValue"µÄtextΪ"paraText" 
 6ÉèÖÃselectÖÐtext="paraText"µÄµ ......

JavascriptÖеÄÕýÔò±í´ïʽ——Ïê½â

ÿ´ÎÓõÄʱºò¶¼ÒªÕÒÒ»±é×ÊÁÏ£¬×ÁÄ¥Ò»±éÓï·¨£¬²»Ê¤Æä·³£¬ÖÕÓÚ϶¨¾öÐÄ°ÑËûÃǶ¼¼ÇÏÂÀ´£¬Ò»´ÎÐԸ㶨£¬ÓÀ¾øºó»¼£¡:)
Ò»¡¢Ê²Ã´ÊÇÕýÔò±í´ïʽ£¿
    ¼òµ¥µØ˵£¬¾ÍÊÇ»ùÓÚ×Ö·û´®µÄģʽƥÅ乤¾ß¡£Êµ¼ÊÓ¦ÓÃÖаüÀ¨×Ö·û´®µÄ²éÕÒ¡¢ÌáÈ¡¡¢Ìæ»»µÈµÈ¡£
¶þ¡¢»ù±¾Óï·¨
    JavascriptÖеÄÕýÔò±í´ïʽµÄÐÎʽһ ......

FusionChart µÄjavascript Ó÷¨

FusionChart  ¾Í²»ÓýéÉÜÁË°Ñ£¬Ò»¿îÖ§³Ö¶àÖÖÓïÑÔµÄͼ±íÉú³É¿Ø¼þ£¬Éú³ÉµÄͼ±í·á¸»£¬ÃÀ¹Û£¬ÇÒÓж¯Ì¬¸Ð£¬ÒòΪËüÉú´æµÄ¶«Î÷¾ÍÊÇÒ»¸öflash¡£Ò»Ï½éÉÜÒ»ÏÂËüµÄjavascript ʵÏÖ·½Ê½°Ñ¡£
·Ï»°ÉÙ˵£¬Ö±½ÓÉÏʵÀý
  <HTML>¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡ <HEAD>¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡ <SCRIPT LANGUAGE="Javascri ......

ʹÓÃjavascript¶¯Ì¬Ìí¼ÓºÍɾ³ýtableµÄÐкÍÁÐ

µÚÒ»ÖÖ·½·¨£ºÊ¹ÓÃinsertRowÌí¼ÓÐУ¬Ê¹ÓÃinsertCellÌí¼Óµ¥Ôª¸ñ£¬ÔÙÓÃinnerHTMLÌî³äµ¥Ôª¸ñ¡£Ê¹ÓÃdeleteRowɾ³ýÐУ¬´úÂëÈçÏ£º
Javascript´úÂ룺
function addRow()
  {
     var root = document.getElementById("tbody")
     var&nb ......

JavaScriptÖÐarguments¶ÔÏó

½ñÌìÍ·¶ù¸´²é´úÂ룬½á¹û·¢ÏÖÓеÄÒ³Ã沢ûÓÐÏàÓ¦µÄDOMÔªËØ£¬µ¼Öµ÷ÓÃfuction³ö´í¡£²ÉÓÃJavaScriptÖÐarguments¶ÔÏó¿ÉÒÔºÜÇáËɵĽâ¾öÕâ¸öÎÊÌ⣬¶ø²»ÐèÒªÔÙÈ¥ÅжÏÔªËØÖ®ÀàµÄ¡£so Good£¡
JavaScriptÖÐargumentsº¯Êý¶ÔÏóÊǸöÔÏó´ú±íÕýÔÚÖ´Ðеĺ¯ÊýºÍµ÷ÓÃËüµÄº¯ÊýµÄ²ÎÊý¡£Ê¹Ó÷½·¨£º
[function.]arguments[n ]
ÆäÖÐfunctionÊÇ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ