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

JavaScript¾²Ì¬·½·¨

       ¾²Ì¬·½·¨µÄʵÖÊÓëÈκÎÆäËûÒ»°ãº¯ÊýûÓÐʲô²»Í¬£¬×îÖ÷ÒªµÄÇø±ðÔÚÓÚ£¬ÆäËûº¯ÊýÊÇÒÔ¶ÔÏóµÄ¾²Ì¬ÊôÐÔÐÎʽ´æÔڵġ£×÷Ϊһ¸öÊôÐÔ£¬ËüÃDz»ÄÜÔڸöÔÏóµÄʵÀýµÄÉÏÏÂÎÄÖзÃÎÊ£¬¶øÖ»ÊôÓÚÖ÷¶ÔÏó±¾ÉíµÄÄǸöÉÏÏÂÎÄÖС£¶ÔÏ°¹ßÁË´«Í³Ààʽ¼¯³ÉµÄÈËÀ´Ëµ£¬Õâ¾ÍÏñÀàÀﶨÒåµÄ¾²Ì¬·½·¨¡£
      ʵ¼ÊÉÏ£¬ÕâÑù±àд´óÂîµÄΨһÓеãʱ£Ö¤¶ÔÏóµÄÃüÃû¿Õ¼äÕû½à£¬µÚÈýÕ£¨¾«Í¨JavaScript£©»á¶ÔÕâ¸ö¸ÅÄî×ö¸üÏêϸÌÖÂÛ¡£´úÂëÇë´ò2-26չʾÁËÒ»¸ö°Ñ¾²Ì¬·½·¨Ìí¼Óµ½¶ÔÏóÖеÄÀý×Ó¡£
      //Ìí¼Óµ½Ò»¸öUser¶ÔÏóµÄ¾²Ì¬·½·¨
User.cloneUser = function(user){
//´´½¨²¢·µ»ØÒ»¸öеÄÓû§
   return new User(
//ÕâÊÇÆäËûÓû§¶ÔÏóµÄ¸´ÖÆ
user.getName(),
user.getAge()
};
};
      ¾²Ì¬·½·¨Ê¹ÎÒÃÇÓöµ½µÄµÚÒ»ÖÖ½öΪ×éÖ¯´úÂë¶øÊÇÓõķ½·¨¡£ÓÉ´ËÎÒÃǽ«×ªÈëÏÂÒ»ÕÅË÷ÒªÌÖÂÛµÄÄÚÈÝ¡£¿ª·¢³öרҵJavaScript´úÂëµÄ¸ù±¾·½·¨Ö®Ò»ÊÇ£¬¿ìËÙ¡¢¾²Ì¬µØÌṩÓëÆäËû´úÂëµÄ½è¿Ú£¬Í¬Ê±±£Ö¤×ÔÉíµÄ¿ÎÀí½âÐÔ¡£ÕâÊÇÒ»¸öÖµµÃŬÁ¦µÄÖØҪĿ±ê£¬Ò²ÊÇÎÒÃÇÒªÔÚÏÂÒ»ÕÅÒª´ïµ½µÄÄ¿±ê¡£


Ïà¹ØÎĵµ£º

javascript ѧϰ±Ê¼Ç£¨3£©

1. º¯ÊýÔÚÖ´ÐÐÍê return Ö¸Áîºó¾Í»áÍ£Ö¹Ö´ÐдúÂë.
function test(Num1,Num2){
return Num1+Num2;
alert(Num1+Num2); //never outputs

2. javascript º¯Êý²»ÄÜÖØÔØ,Ò²¾ÍÊÇ˵¿ÉÒÔÔÚͬһ¸ö×÷ÓÃÓòÖж¨Òå¶à¸öͬÃûº¯Êý,¶ø×îÖÕÖ´ÐеÄÊǺóÒ»¸öº¯Êý.
function test(num){
alert(num+10);
}
function ......

javascript ѧϰ±Ê¼Ç£¨4£©

1. Ò»ÖÖÃæÏò¶ÔÏóÓïÑÔÐèÒª¿ª·¢ÕßÌṩÒÔÏÂËÄÖÖ»ù±¾ÄÜÁ¦¡£
£¨1£©·â×°---°ÑÏà¹ØÐÅÏ¢£¨ÎÞÂÛÊôÐÔ»¹ÊÇ·½·¨£©´æ´¢ÔÚ¶ÔÏóÖеÄÄÜÁ¦¡£
£¨2£©¾Û¼¯---°ÑÒ»¸ö¶ÔÏó´æ´¢ÔÚÁíÒ»¸ö¶ÔÏóÄÚµÄÄÜÁ¦¡£
£¨3£©¼Ì³Ð---ÓÉÁíÒ»¸öÀࣨ»ò¶à¸öÀࣩµÃÀ´ÀàµÄÊôÐÔ»ò·½·¨µÄÄÜÁ¦¡£
£¨4£©¶à̬---±àдÄÜÒÔ¶àÖÖ·½·¨ÔËÐеĺ¯Êý»ò·½·¨µÄÄÜÁ¦¡£
2. °Ñ¶ÔÏóµÄËù ......

JavaScript WebÁ÷³Ì¶¨Ò幤¾ß

Submitted by gouki on 2008, December 4, 11:47 PM. Javascript
ÓÃjavascript+vmlÀ´×ö¹¤×÷Á÷£¬È·ÊµÊǵÚÒ»´Î¿´µ½£¬ËùÒÔÎÒÔÚ¿´µ½ÓÐÕâ¸öÐÂÎŵÄʱºò£¬¾Í¾õµÃÌرðµÄ³Ô¾ª¡£µ±ÄêµÄTRS¾ÍÊÇÒòΪÓÐÒ»¸öactivex°æµÄ¹¤×÷Á÷¿Ø¼þµÄCMS£¬µ¼ÖÂËûµÄ¼Û¸ñ·Ç³£µÄ¸ß£¬½ñÌìÄܹ»¿´µ½ÓÐjavascript°æµÄ£¬¾ªÑÈÊÇÄÑÃâµÄ¡£¡£¡£
Ö»ÊDz¢·ÇËùÓеĻúÆ÷¶¼Ö ......

javascript evalµÄ¼òµ¥Ó÷¨

js eval
evalº¯Êý½ÓÊÕÒ»¸ö²ÎÊýs£¬Èç¹ûs²»ÊÇ×Ö·û´®£¬ÔòÖ±½Ó·µ»Øs¡£·ñÔòÖ´ÐÐsÓï¾ä¡£Èç¹ûsÓï¾äÖ´Ðнá¹ûÊÇÒ»¸öÖµ£¬Ôò·µ»Ø´ËÖµ£¬·ñÔò·µ»Øundefined¡£
Àý×Ó
Ö±½ÓÔËËã
alert(eval('1+2')); // ->3
¸³Öµ
eval('var aa = 5');
alert(aa); // ->5
ÀàÐÍת»»
var yy = "{a:'aa',b:'bb'}";
yy = eval('(' + yy + ')'); ......

JavaScript˽ÓгÉÔ±

//´´½¨Ò»¸öеÄÓû§¶ÔÏ󣬽ÓÊÜÒ»¸öÓÐÐí¶àÊôÐԵĶÔÏó×÷Ϊ²ÎÊý
function User(properties)
{
    for(var i in properties){(function(which){
    var p=i;
    //´´½¨´ËÊôÐÔµÄÒ»¸öеĶÁÈ¡Æ÷(getter)
    which["get"+p] = function(){
&nbs ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ