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

javascript ѧϰ±Ê¼Ç£¨5£© ¼Ì³Ð

1. ijЩ»ùÀàÈç¹û²»Ö±½ÓʹÓÃ,¶ø½ö½öÖ»ÊÇÓÃÓÚ¸ø×ÓÀàÌṩͨÓõĺ¯Êý,ÕâÖÖÇé¿öÏÂ,»ùÀà±»¿´×÷³éÏóÀà.
2. ÔÚ javascript µÄÀàÖÐËùÓеķ½·¨ºÍÊôÐÔ¶¼ÊÇ"¹«ÓõÄ".
3. javascript Öеļ̳в¢²»ÊÇÃ÷È·¹æ¶¨µÄ,¶øÊÇͨ¹ýÄ£·ÂÀ´ÊµÏÖµÄ.ÓÐÒÔÏ·½·¨:
(1). ¶ÔÏóð³ä
function A(sColor){
this.color = sColor;
this.showColor = function(){
alert(this.color);
};
}
function B(sColor,sName){
this.newMethod = A;
this.newMethod(sColor);
delete this.newMethod;
this.name = sName; //Ðµķ½·¨ºÍÊôÐÔÒªÔÚɾ³ýÁËз½·¨µÄ¶¨ Òåºó¶¨Òå
this.showName = function(){
alert(this.name);
};

        ¶ÔÏóð³ä·½·¨¿ÉÒÔÖ§³Ö¶àÖØÀà¼Ì³Ð,Ò²¾ÍÊÇÒ»¸öÀà¿ÉÒԼ̳ÐÓÚ¶à¸öÀà
        Èç¹û´æÔÚÒ»¸öÀà C Ïë¼Ì³ÐÀà A ºÍ B,Ö»ÒªÕâÑù:
                function C(){
this.newMethod = A;
this.newMethod();
delete this.newMethod
this.newMethod = B;
this.newMethod();
delete this.newMethod

       µ«ÊÇҪעÒâÈç¹û A ºÍ B ÖдæÔÚͬÃûµÄÊôÐÔ»òÕß·½·¨,Ôò B ¾ßÓиßÓÅÏȼ¶,ÒòΪËûÊǺóÃæµÄÀà¼Ì³Ð.
     (2). call() ·½·¨
                function B(sColor,sName){
//this.newMethod = A;
//this.newMethod(sColor);
//delete this.newMethod;
A.call(this,sColor);
this.name = sName;
this.showName = function(){
alert(this.name);
};

      (3). apply() ·½·¨
                function B(sColor,sName){
//this.newMethod = A;
//this.newMethod(sColor);
//delete this.newMethod;
A.apply(this,new Array(sColor));
this.name = sName;
this.showName = function(){
alert(this.name);
};

       (4). Ô­ÐÍÁ´,Ô­ÐÍÁ´²»Ö§³Ö¶àÖØ¼Ì³Ð
                function A(){
}
A.p


Ïà¹ØÎĵµ£º

javascript StyleSheetÑùʽ²Ù×÷Àà

ÔçÉÏÔÚcsdnÉÏ¿´ÓÐÈËÎÊÒ³Ãæstyle sheetÔõôÐÞ¸ÄÀïÃæµÄrule,¾ÍдÁ˸öÀà,¸ÃÀà¶Ô¼æÈÝFFºÍIE×öÁË´¦Àí¡£
/**//*--------------------------------------------
    ÃèÊö : Ìí¼ÓеÄÑùʽrule
    ²ÎÊý : styleSheetsË÷Òý
    ´úÂë :&nb ......

ÏòAsp.netÒ³ÃæÌí¼Ójavascript½Å±¾

1¡¢Ê¹ÓÃPage.ClientScript.RegisterClientScriptBlock
RegisterClientScriptBlock·½·¨¿ÉÒÔ°ÑJavaScriptº¯Êý·ÅÔÚÒ³ÃæµÄ¶¥²¿¡£Ò²¾ÍÊÇ˵£¬¸Ã½Å±¾ÓÃÓÚÔÚä¯ÀÀÆ÷ÖÐÆô¶¯Ò³Ãæ¡£
Code
<%@ Page Language="C#" %>
<script runat="server">
protected void Page_Load(object send ......

javascript replace ·½·¨ÓëjavaÖеÄreplace·½·¨


²»Óò»ÖªµÀ,Ò»ÓòÅÖªµÀÕâÁ½ÕßÊDz»´óÒ»ÑùµÄ,ÏñÔÚjavaÖÐ,ÊÇÖ±½ÓʹÓà ,Èç str1.replace("$","*") °Ñ$ºÅ±ä³É*ºÅ
µ«ÔÚjavascript¾Í²»Ò»Ñù,ҪʵÏÖÉÏÃæµÄ¹¦ÄÜÊÇÕâÑùд: str.replace(/&/g,"*") ÆäÖеÄgÊDzÎÊý,˵Ã÷Òª½«È«²¿µÄ$¶¼±ä³É*
ÏÂÃæ°ÑjavascriptµÄÕ³ÌùÔÚÏÂÃæ:
¶¨ÒåºÍÓ÷¨
replace() ·½·¨ÓÃÓÚÔÚ×Ö·û´®ÖÐÓÃһЩ×Ö·ûÌ ......

javascript¶íÂÞ˹·½¿é¡¾¸½´øÔ´Âë¡¿

ÔÚ¿´ÁËW3CµÄ¹ØÓÚECMScriptµÄ¶ÔÏ󼰼̳кó£¬ÏÈÊÇÍê³Ḛ́³ÔÉßµÄʵÏÖ¡£×î½üÓÖ³é¿ÕʵÏÖÁË϶íÂÞ˹·½¿é¡£¶ÔÓÚ¶íÂÞ˹·½¿éÖØÒªµÄ²»ÊÇÓÎÏ·±¾Éí£¬¶øÊÇÔÚÕâ¸ö¹ý³ÌÖжÔÓÚjavascript¼Ì³ÐµÄʹÓá£
µ±È»ÔÚһЩ¶ÔÏóµÄ»®·Ö¼°Ê¹Óùý³Ì»¹´æÔÚ覴ã¬Ëã·¨Ò²²»Ëã×îÓÅ£¬·¢²¼³öÔ´ÂëÖ»ÊÇÏë×ö¸ö½»Á÷¡£ÒÔϾÍÌṩԴ´úÂ빩´ó¼Ò²Î¿¼£¬Ò²Îª×Ô¼º×ö¸ö±¸·Ý¡£ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ