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

javascript¿ò¼ÜÖ®¼Ì³Ð»úÖÆ

´óÒ»µãµÄ¿ò¼Ü¶¼ÓÐÕâ¸ö¶«Î÷¡£PrototypeÔ­À´µÄ¼Ì³Ð»úÖƷdz£Èõ£¬ÎªÁËÓëmootools¶Ô¿¹Ò²Ç¿»¯ÁËÕâÒ»·½Ãæ¡£ÂҪÓÃÔ­Ðͼ̳ÐÀ´Ä£·ÂÀà¼Ì³Ð£¬¶¼»ù±¾´æÔÚÒ»¸ö¿Ë¡º¯Êý¡£°Ñ¸¸ÀàµÄÔ­ÐÍÊôÐÔ¸´ÖƵ½×ÓÀàÉÏÈ¥¡£ÀíÄîµÄ¶«Î÷ÔÝʱÕâô¶à£¬¶¯ÊÖʵ¼ùÒ»ÏÂ×îʵ¼Ê¡£ÎÒÃÇÉè¼ÆÒ»¸öÊý×éÀ࣬ӵÓÐÔ­ÉúÊý×éµÄÄÜÁ¦ÓëÐÂÀ©Õ¹µÄÄÜÁ¦¡£

var isNumber = function(n){
return typeof n === 'number' && isFinite(n);
}
var vArray = function(){
if(arguments.length == 0){
return [];
}else if(arguments.length == 1 && isNumber(arguments[0])){
return new Array(arguments[0]);
}else if(arguments.length > 1){
return Array.prototype.slice.apply(arguments);
}
}
var a = vArray();
alert(a);
var b = vArray(7);
alert(b);
var c = vArray(1,3,"˾ͽÕýÃÀ",true);
alert(c);

ÔËÐдúÂë
ºÜÏÔÈ»ÕâÊǹ¤³§·½·¨£¬Éú³ÉµÄÔ­ÉúÊý×飬Èç¹ûÒªÀ©Õ¹¶ø²»ÎÛȾԭÉúÊý×é¾ÍÓÖÒªÔÙ¼ÓÒ»ÖØ°ü×°¡£ÎÒÃÇ¿´¼Ì³ÐÊÇÔõÑùʵÏֵġ£ÕâÉæ¼°µ½Á½¸öÀ࣬ԭÉúÊý×éÀàÓëÐÂÊý×éÀà¡£ÏÈ¿´´úÂ룺

var Parent = function(){};
Parent.prototype = Array.prototype;
var Array2 = function(){};
Array2.prototype = new Parent;
Array2.prototype.newMethod = function(){
return "newMethod";
};
Array2.prototype.constructor = Array2;
var a = new Array2("dd",4);
alert(a.newMethod)
var b = new Array("dd",4);
alert(b.newMethod)

ÔËÐдúÂë
ÓÉÓÚjavascriptµÄÔ­ÐÍÁ´µÄ¹Øϵ£¬ÎÒÃDz»ÄÜÖ±½Óvar Array2 = Array;var a = new Array2£»ÕâÑùÒ»µ©´ÓArray2µÄÔ­ÐÍÌí¼Óз½·¨£¨Ìí¼Ó·½·¨¶¼½¨ÒéÍùÔ­ÐÍÀï¼Ó£¬²»½¨Òé×ö³ÉÀà·½·¨£©Ê±£¬ArrayµÄÔ­ÐÍÒ²±»¼ÓÉÏÁË£¬ÒòΪËüÃÇÊÇÔÚͬһÌõ´¬ÉÏ¡£ÎÒÃDZØÐë¶Ï¿ªËüÃÇ¡£ÓÚÊÇÎÒÃÇÐèÒªÒ»¸öParentº¯Êý×öÇŽӡ£ÎÒÃÇ¿ÉÒÔ˵ArrayΪĿ±ê¸¸À࣬ParentΪÕæÕý¸¸Àà¡£ÏÈ°ÑÄ¿±ê¸¸ÀàµÄÔ­Ð͸³¸øParentµÄÔ­ÐÍ£¬ÕâÑùParent¾ÍÓµÓÐÆäËùÓй«¿ªµÄ·½·¨£¬È»ºóÎÒÃÇÔÙ°ÑÕâЩ·½·¨¸³¸øArray2¡£µ«ÕâʱArray2µÄʵÀýµÄconstructor ÈÔΪԭÉúµÄÊý×飬ÎÒÃÇÒªÐÞÕýһϣ¬Ò²¾ÍÊÇ°ÑËüµÄÔ­ÐÍÉϵÄconstructorÊô


Ïà¹ØÎĵµ£º

DIVÖйö¶¯ÌõÉèÖõ½Ëæ»úλÖÃ(CSS+Javascript)

¸Õ²ÅÒ»¸öÅóÓѸæËßÎÒËûµÄblogÓÑÇéÁ´½ÓÌ«¶àÁË£¬ËùÒÔ°ÑËùÓÐÁ´½Ó·Åµ½Ò»¸öDIVÖУ¬¼ÓÁ˸ö¹ö¶¯Ìõ£¬¿ÉÊÇËûÓÖ²»Ïëÿ´Î±ðÈËÀ´¿´£¬¿´µ½µÄ¶¼ÊÇÇ°Ã漸¸öÁ´½Ó£¬ÓÚÊÇÎÊÎÒÓÐûÓÐʲô°ì·¨£¬ÏëÁËÒ»¸ö£¬ºÇºÇ£¬ÕýºÃÓиö°ì·¨
styleºóÃæÓÃÓÚÏÞ¶¨DIVÑùʽ²¢¼Ó¹ö¶¯Ìõ£¬Õâ¸ö²»¶à˵
¹Ø¼üµÄµØ·½ÆäʵºÜ¼òµ¥£¬×îºóÁ½ÐÐJavascript¾ÍÊÇÁË£¬Æð×÷ÓõÄÖ»ÓÐ×îº ......

[´ÓjQuery¿´JavaScript]

jQueryƬ¶Î£º
var
// Will speed up references to window, and allows munging its name.
window = this,
// Will speed up references to undefined, and allows munging its name.
undefined,
// Map over jQuery in case of overwrite
_jQuery = window.jQuery,
// Map over the $ in case of overwrit ......

JavascriptÖÐ×î³£ÓõÄ55¸ö¾­µä¼¼ÇÉ

 1. oncontextmenu="window.event.returnValue=false" ½«³¹µ×ÆÁ±ÎÊó±êÓÒ¼ü
<table border oncontextmenu=return(false)><td>no</table> ¿ÉÓÃÓÚTable
2. <body onselectstart="return false"> È¡ÏûÑ¡È¡¡¢·ÀÖ¹¸´ÖÆ
3. onpaste="return false" ²»×¼Õ³Ìù
4. oncopy="return false;" oncut="re ......

JavascriptÖÐ×î³£ÓõÄ55¸ö¾­µä¼¼ÇÉ

 1. oncontextmenu="window.event.returnValue=false" ½«³¹µ×ÆÁ±ÎÊó±êÓÒ¼ü
<table border oncontextmenu=return(false)> <td>no </table> ¿ÉÓÃÓÚTable

2. <body onselectstart="return false"> È¡ÏûÑ¡È¡¡¢·ÀÖ¹¸´ÖÆ

3. onpaste="return false&quo ......

¾­³£Óõ½µÄjavaScript¼¼Êõ´úÂë

 Ò»¡¢ÑéÖ¤Àà
1¡¢Êý×ÖÑéÖ¤ÄÚ
1.1 ÕûÊý
1.2 ´óÓÚ0µÄÕûÊý £¨ÓÃÓÚ´«À´µÄIDµÄÑéÖ¤)
1.3 ¸ºÕûÊýµÄÑéÖ¤
1.4 ÕûÊý²»ÄÜ´óÓÚiMax
1.5 ÕûÊý²»ÄÜСÓÚiMin
2¡¢Ê±¼äÀà
2.1 ¶Ìʱ¼ä£¬ÐÎÈç (13:04:06)
2.2 ¶ÌÈÕÆÚ£¬ÐÎÈç (2003-12-05)
2.3 ³¤Ê±¼ä£¬ÐÎÈç (2003-12-05 13:04:06)
2.4 Ö»ÓÐÄêºÍÔ¡£ÐÎÈç(2003-05,»òÕß2003-5)
2.5 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ