¡¶Îò͸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²Î
Ïà¹ØÎĵµ£º
Ò»¡¢ºǫ́£¨.csÎļþ£©·½·¨£º
public string GetString(string name)
{
return ("Hello " + name);
}
&n ......
½ñÌìµÄ»°ÌâÊÇÈçºÎ¸Ä½ø×Ô¼ºÍøÕ¾µÄ½çÃæ»òÌá¸ßÍøÕ¾µÄÊÓ¾õÌåÑ飬´Ó¶øÈÃÓû§¼ÇÒäÓÌС£
¡¡¡¡ÎÒÃÇÓÐÈýÖÖÖ÷ÒªµÄ·½·¨(´ÓÄѵ½Ò×):×Ô¼º¶¯ÊÖд½Å±¾;ʹÓÃÀàËÆÓÚjQueryºÍmooToolsµÄJavaScript¿ò¼Ü(¿ÉÒÔÈñàд´úÂë±ä
µÃ¸üÈÝÒ×Щ);ʹÓÃÄܹ¤×÷ÓÚÏÖÓеÄJavaScript¿ò¼ÜϵÄÌáÇ°Ô¤ÖúõĽű¾»òÄÇÖÖ´ÓÍ·¿ªÊ¼¿ª·¢µÄ´´½¨Õß¡£ÕâƪÎÄÕÂÊʺÏÄÇЩ´òË ......
Thickbox
-
»ùÓÚ
jQuery
£¬Ö§³Ö AJAX£¬ÇáÁ¿¼¶µÄ¶øÇұȽϸßЧ¡£Ö§³ÖͼƬÓëHTMLÄÚÈÝ¡£´óСԼΪ
40k£¬Ä¿Ç°»¹¿É×÷Ϊ WordPress
µÄ²å¼þʹÓá£Õâ¸öjsµÄÓŵãÔÚÓÚÓ룬¸¸¼¶µÄÔÒ³Ãæ¹ö¶¯ÌõËæÊó±ê¹ö¶¯µÄʱºò£¬µ¯³öµÄ²ã²¢²»Òƶ¯£¬¶øʼÖÕ´¦ÓÚä¯ÀÀÆ÷µÄ¹Ì¶¨Î»Öá£
GreyBox
- ´´½¨ iframe µÄµ¯³ö½çÃ棬¿ÉʹÓÃͼƬ ......
C#´úÂëÓëjavaScriptº¯ÊýµÄÏ໥µ÷ÓÃ
ÎÊ£º
1.ÈçºÎÔÚJavaScript·ÃÎÊC#º¯Êý?
2.ÈçºÎÔÚJavaScript·ÃÎÊC#±äÁ¿?
3.ÈçºÎÔÚC#ÖзÃÎÊJavaScriptµÄÒÑÓбäÁ¿?
4.ÈçºÎÔÚC#ÖзÃÎÊJavaScriptº¯Êý?
ÎÊÌâ1´ð°¸ÈçÏ£º
javaScriptº¯ÊýÖÐÖ´ÐÐC#´úÂëÖеĺ¯Êý£º
·½·¨Ò»£º1¡¢Ê×ÏȽ¨Á¢Ò»¸ö°´Å¥£¬ÔÚºǫ́½«µ÷Óûò´¦ÀíµÄÄÚÈÝдÈëbutton_clickÖÐ ......
ÒýÑÔ
ÈκÎÒ»¸öº¯Êý¶¼¿ÉÒÔΪÆ䶯̬µØÌí¼Ó»òÈ¥³ýÊôÐÔ£¬ÕâЩÊôÐÔ¿ÉÒÔÊǼòµ¥ÀàÐÍ£¬¿ÉÒÔÊǶÔÏó£¬Ò²¿ÉÒÔÊÇÆäËûº¯Êý¡£Ò²¾ÍÊÇ˵£¬º¯Êý¾ßÓжÔÏóµÄÈ«²¿ÌØÕ÷£¬ÄãÍêÈ«¿ÉÒ԰Ѻ¯Êýµ±¶ÔÏóÀ´Óá£Æäʵ£¬º¯Êý¾ÍÊǶÔÏó£¬Ö»²»¹ý±ÈÒ»°ãµÄ¶ÔÏó¶àÁËÒ»¸öÀ¨ºÅ“()”²Ù×÷·û£¬Õâ¸ö²Ù×÷·ûÓÃÀ´Ö´Ðк¯ÊýµÄÂß¼¡£¼´£¬º¯Êý±¾Éí»¹¿ÉÒÔ±»µ÷ ......