Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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


Ïà¹ØÎĵµ£º

JavaScript ͼÏñµØͼ

 
ͼÏñµØͼָµÄÊÇ´øÓпɵã»÷ÇøÓòµÄͼÏñ¡£
ʵÀý
¼òµ¥µÄ HTML ͼÏñÓ³Éä
±¾ÀýÑÝʾһ·ùûÓÐÌí¼Ó JavaScript µÄͼÏñÓ³Éä¡£
Ìí¼ÓÁË JavaScript µÄͼÏñÓ³Éä
±¾ÀýÑÝʾһ·ùÌí¼ÓÁË JavaScript µÄͼÏñÓ³É䣬µ±Êó±ê¸¡¶¯ÓÚij¸öÈȵãÉÏʱ£¬»áµ÷Óà JavaScript º¯ÊýÀ´ÏÔʾÈȵãËù¶ÔÓ¦µÄÐÇÇòµÄ¼ò½é¡£
JavaScript ͼÏñµØͼ
ÎÒÃÇÒѾ ......

³£ÓÃJavaScriptÅжÏ×Ö·û´®µÄһЩ´úÂë

 //ÅжÏÊäÈëÄÚÈÝÊÇ·ñΪ¿Õ
function IsNull(){
var str = document.getElementById('str').value.trim();
if(str.length==0){
alert('¶Ô²»Æð£¬Îı¾¿ò²»ÄÜΪ¿Õ»òÕßΪ¿Õ¸ñ!');//Ç뽫“Îı¾¿ò”¸Ä³ÉÄãÐèÒªÑéÖ¤µÄÊôÐÔÃû³Æ!
}
}

//ÅжÏÈÕÆÚÀàÐÍÊÇ·ñÎ ......

JavaScript »ñÈ¡¿Í»§¶Ë¼ÆËã»úÓ²¼þ¼°ÏµÍ³ÐÅÏ¢

JavaScript »ñÈ¡¿Í»§¶Ë¼ÆËã»úÓ²¼þ¼°ÏµÍ³ÐÅÏ¢
ͨ¹ýWMIÀ´ÊµÏÖ»ñÈ¡¿Í»§¶Ë¼ÆËã»úÓ²¼þ¼°ÏµÍ³ÐÅÏ¢:
1//ϵͳÐÅÏ¢»ñÈ¡
2function getSysInfo(){
3 var locator = new ActiveXObject ("WbemScripting.SWbemLocator");
4 var service = locator.ConnectServer(".");
5 //CPUÐÅÏ¢
6 var cpu = new Enu ......

¡ü¡ú40ÖÖÍøÒ³³£ÓÃС¼¼ÇÉ(javascript)¡û¡ý

 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:window.showModalDialog»º´æÎÊÌâ

 À´Ô´£ºhttp://blog.csdn.net/Mr_Von/archive/2009/04/29/4136273.aspx
window.showModalDialog»áÓлº´æ£¬µ¼Öµڶþ´Î²»½øÈëpageload£¬½â¾ö·½·¨£º¸úÒ»¸öËæ»úµÄ²ÎÊý£º
          var time =new Date();
          var iW ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ