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

¡¶Îò͸javascript¡·Ñ§Ï°±Ê¼Ç£ºÁù¡¢·Å϶ÔÏó

ÒýÑÔ
 
ÔÙÀ´¿´¿´functionÓëobjectµÄ³¬È»½áºÏ°É¡£
 
    ÔÚÃæÏò¶ÔÏóµÄ±à³ÌÊÀ½çÀÊý¾ÝÓë´úÂëµÄÓлú½áºÏ¾Í¹¹³ÉÁ˶ÔÏóµÄ¸ÅÄî¡£×Ô´ÓÓÐÁ˶ÔÏ󣬱à³ÌÊÀ½ç¾Í±»»®·Ö³ÉÁ½²¿·Ö£¬Ò»¸öÊǶÔÏóÄÚµÄÊÀ½ç£¬Ò»¸öÊǶÔÏóÍâµÄÊÀ½ç¡£¶ÔÏóÌìÉú¾ßÓÐ×Ô˽µÄÒ»Ã棬ÍâÃæµÄÊÀ½çδ¾­ÔÊÐíÊDz»¿É·ÃÎʶÔÏóÄÚ²¿µÄ¡£¶ÔÏóÒ²Óд󷽵ÄÒ»Ã棬Ëü¶ÔÍâÌṩÊôÐԺͷ½·¨£¬Ò²ÎªËûÈË·þÎñ¡£²»¹ý£¬ÔÚÕâÀïÎÒÃÇҪ̸µ½Ò»¸öÓÐȤµÄÎÊÌ⣬¾ÍÊÇ“¶ÔÏóµÄ×ÔÎÒÒâʶ”¡£
 
Àí½âthis
 
    JavaScriptÖÐÒ²ÓÐthis£¬µ«Õâ¸öthisÈ´ÓëC++¡¢C#»òJavaµÈÓïÑÔµÄthis²»Í¬¡£Ò»°ã±à³ÌÓïÑÔµÄthis ¾ÍÊǶÔÏó×Ô¼º£¬¶ø JavaScript µÄ this È´²¢²»Ò»¶¨£¡this ¿ÉÄÜÊÇÎÒ£¬Ò²¿ÉÄÜÊÇÄ㣬¿ÉÄÜÊÇËû£¬·´ÕýÊÇÎÒÖÐÓÐÄ㣬ÄãÖÐÓÐÎÒ£¬Õâ¾Í²»ÄÜÓÃÔ­À´µÄÄǸö“×ÔÎÒ”À´Àí½â JavaScriptÕâ¸öthisµÄº¬ÒåÁË¡£Îª´Ë£¬ÎÒÃDZØÐëÊ×ÏÈ·ÅÏÂÔ­À´¶ÔÏóµÄÄǸö“×ÔÎÒ”¡£
 
<script language="javascript">
function WhoAmI(){
    //´ËʱÊÇ this µ±Ç°Õâ¶Î´úÂëµÄÈ«¾Ö¶ÔÏó£¬ÔÚä¯ÀÀÆ÷ÖоÍÊÇwindow ¶ÔÏó£¬ÆänameÊôÐÔΪ¿Õ×Ö·û´®¡£Êä³ö£ºI'm of object
   alert("i'm " + this.name + " of " + typeof(this));
   alert("url is " + this.location);    //Ö¤Ã÷´ËʱµÄthisÊÇwindow¶ÔÏó
}
WhoAmI();    //Ö´ÐÐ
 
var Bill = {name:"BillGates"}; //´´½¨Ò»¸ö¶ÔÏó
Bill.WhoAmI = WhoAmI;  //ΪBillÔö¼ÓÒ»¸öWhoAmIµÄ·½·¨£¬²¢¸³ÎªÉÏÃæµÄ·½·¨
Bill.WhoAmI();     //Ö´ÐÐ, ´ËʱthisÊÇBill
 
WhoAmI.call(Bill); //Ö´ÐУ¬ ´ËʱthisÊÇBill
 
({name:"noName", WhoAmI:WhoAmI}).WhoAmI();
</script>
 
    ÔÚJavaScriptº¯ÊýÖУ¬ÄãÖ»ÄÜ°Ñthis¿´³Éµ±Ç°Òª·þÎñµÄ“Õâ¸ö”¶ÔÏó¡£thisÊÇÒ»¸öÌØÊâµÄÄÚÖòÎÊý£¬¸ù¾Ýthis²ÎÊý£¬Äú¿ÉÒÔ·ÃÎʵ½“Õâ¸ö”¶ÔÏóµÄÊôÐԺͷ½·¨£¬µ«È´²»Äܸøthis²ÎÊý¸³Öµ¡£ÔÚÒ»°ã¶ÔÏóÓïÑÔÖУ¬·½·¨Ìå´úÂëÖеÄthis¿ÉÒÔÊ¡ÂԵģ¬³ÉԱĬÈ϶¼Ê×ÏÈÊÇ“×Ô¼º”µÄ¡£µ«JavaScriptÈ´²»Í¬£¬ÓÉÓÚ²»´æÔÚ“×ÔÎÒ”£¬µ±·ÃÎÊ“Õâ¸ö”¶ÔÏóʱ£¬this²»¿ÉÊ¡ÂÔ£¡£¨Õâ¶Î»°ºÜ³éÏó£©
 
     ÉÏÃæÑÝʾÁ˶àÖÖthisµÄ´«µÝ·½·¨£¬JavaScriptÌṩÁË´«µÝthis²Î


Ïà¹ØÎĵµ£º

javascript &cssʵÏֵij¤ÎÄÕ·ÖÒ³

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>FLYSO Blog-- JS´úÂëʵÏÖµÄ×Ô¶¯·ÖҳЧ¹û~!</TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT=""& ......

ÔÚJavascriptÖд´½¨¶ÔÏó

ÔÚJavascriptÖÐûÓÐclassÀ࣬µ«ÊÇͬÑùÒ²¿ÉÒÔ½øÐжÔÏóµÄ´´½¨¡£ÔÚÃæÏò¶ÔÏóµÄÓïÑÔÖÐÐèҪʵÀý»¯Ä³¸ö¾ßÌåÀàµÄʵÀý£¬ÔÚJavascriptÖÐÔò²»Óá£
ÔÚJavascriptÀ¶ÔÏñ¿ÉÒÔ´´½¨ÐµĶÔÏó£¬Ò²¿ÉÒԼ̳Ð×ÔÆäËû¶ÔÏó¡£Õâ¸ö¸ÅÄî³ÆΪԭÐÍ»¯¼Ì³Ð(prototypal inheritance)¡£
Èκκ¯ÊýÔÚJavascript Öж¼¿ÉÒÔ±»ÊµÀý»¯Ò»¸ö¶ÔÏó¡£
³ÌÐòÈçÏ£º
// ......

12¸öÓÅÐãµÄjavascript(ajax)µ¯³ö²ã

Thickbox

-
»ùÓÚ
jQuery
£¬Ö§³Ö AJAX£¬ÇáÁ¿¼¶µÄ¶øÇұȽϸßЧ¡£Ö§³ÖͼƬÓëHTMLÄÚÈÝ¡£´óСԼΪ
40k£¬Ä¿Ç°»¹¿É×÷Ϊ WordPress
µÄ²å¼þʹÓá£Õâ¸öjsµÄÓŵãÔÚÓÚÓ룬¸¸¼¶µÄÔ­Ò³Ãæ¹ö¶¯ÌõËæÊó±ê¹ö¶¯µÄʱºò£¬µ¯³öµÄ²ã²¢²»Òƶ¯£¬¶øʼÖÕ´¦ÓÚä¯ÀÀÆ÷µÄ¹Ì¶¨Î»Öá£
 
GreyBox

- ´´½¨ iframe µÄµ¯³ö½çÃ棬¿ÉʹÓÃͼƬ ......

01 JavaScript¸ÅÊö

Java,JavaScript,JScript Çø±ð
ÕâÈý¸öÓïÑÔ·Ö±ðÊÇÈý¸ö¹«Ë¾¿ª·¢µÄ£¬SUNµÄJava£¬NetscapeµÄJavaScript£¬MicrosoftµÄJScript
JavaScriptÊÇÓÉNetscape¹«Ë¾¿ª·¢²¢ËæNavigatorµ¼º½ÕßÒ»Æð·¢²¼µÄ¡¢½éÓÚJavaÓëHTMLÖ®¼ä¡¢»ùÓÚ¶ÔÏóʼþÇý¶¯µÄ±à³ÌÓïÑÔ£¬²»ÐèÒªJava±àÒëÆ÷£¬¶øÊÇÖ±½ÓÔËÐÐÔÚWebä¯ÀÀÆ÷ÖУ¬ËüµÄÇ°ÉíÊÇLive Script¡£
JScr ......

¡¶Îò͸javascript¡·Ñ§Ï°±Ê¼Ç£º¶þ¡¢»Ø¹é¼òµ¥

ÒýÑÔ
 
ÒªÀí½â JavaScript£¬ÄãµÃÊ×ÏÈ·Å϶ÔÏóºÍÀàµÄ¸ÅÄ»Øµ½Êý¾ÝºÍ´úÂëµÄ±¾Ô­¡£Ç°Ãæ˵¹ý£¬±à³ÌÊÀ½çÖ»ÓÐÊý¾ÝºÍ´úÂëÁ½ÖÖ»ù±¾ÔªËØ£¬¶øÕâÁ½ÖÖÔªËØÓÖÓÐמÀ²ø²»ÇåµÄ¹Øϵ¡£JavaScript¾ÍÊÇ°ÑÊý¾ÝºÍ´úÂ붼¼ò»¯µ½×îԭʼµÄ³Ì¶È¡£
 
»ù±¾ÀàÐÍ
Ò»¡¢¼òµ¥Êý¾ÝÀàÐÍ£ºundefined¡¢null¡¢boolean¡¢number¡¢string£¨×¢Ò⣺¶¼Ê ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ