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
Ïà¹ØÎĵµ£º
ͼÏñµØͼָµÄÊÇ´øÓпɵã»÷ÇøÓòµÄͼÏñ¡£
ʵÀý
¼òµ¥µÄ HTML ͼÏñÓ³Éä
±¾ÀýÑÝʾһ·ùûÓÐÌí¼Ó JavaScript µÄͼÏñÓ³Éä¡£
Ìí¼ÓÁË JavaScript µÄͼÏñÓ³Éä
±¾ÀýÑÝʾһ·ùÌí¼ÓÁË JavaScript µÄͼÏñÓ³É䣬µ±Êó±ê¸¡¶¯ÓÚij¸öÈȵãÉÏʱ£¬»áµ÷Óà JavaScript º¯ÊýÀ´ÏÔʾÈȵãËù¶ÔÓ¦µÄÐÇÇòµÄ¼ò½é¡£
JavaScript ͼÏñµØͼ
ÎÒÃÇÒѾ ......
ÓÃJavaScript×öµÄÕ¾ÄÚËÑË÷²»½ö±à³ÌʵÏÖ¡¢Î¬»¤ÆðÀ´ºÜ¼òµ¥£¬¶øÇÒËüÄÜÔÚ¿Í»§¶Ëä¯ÀÀÆ÷Ö±½ÓÖ´ÐУ¬ÎÞÐë·þÎñÆ÷µÄÖ§³Ö£¬Ò²¿ÉÒÔÊ¡È¥ÉêÇëÓнű¾Ö´ÐÐȨÏÞ¿Õ¼äµÄÂé·³¡£ËùÒÔ£¬Ö»ÒªÄãÔ¸Ò⶯ÊÖ£¬ÓиöÈËÖ÷Ò³¾ÍÄÜÓÐ×Ô¼ºµÄÕ¾ÄÚËÑË÷¡£ÏÂÃæÈÃÎÒÃǹ²Í¬À´×öÒ»¸ö»ùÓÚ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 ......
ʵÏÖЧ¹û£º
ÒýÈëJSºÍCSSÎļþ£º
<mce:script type='text/javascript' src="dropdown/jquery-1.2.3.min.js" mce_src="dropdown/jquery-1.2.3.min.js"></mce:script>
<mce:script type='text/javascript' src="dropdown/menu.js" mce_src="dropdown/menu.js"></mce:script>
<link rel=" ......
/*
ÓÉÓÚjavascriptÊÇÒ»ÖÖÎÞÀàÐÍÓïÑÔ,ËùÒÔÒ»¸öÊý×éµÄÔªËØ¿ÉÒÔ¾ßÓÐÈÎÒâµÄÊý¾ÝÀàÐÍ,ͬһ¸öÊý×éµÄ²»Í¬ÔªËØ
¿ÉÒÔ¾ßÓв»Í¬µÄÀàÐÍ,Êý×éµÄÔªËØÉèÖÿÉÒÔ°üº¬ÆäËûÊý×é,ÕâÑù¾Í¿ÉÒÔ´´½¨Ò»¸ö¸´ÔÓµÄÊý×éÁË.
²¢ÇÒÔÚÕâµãÉÏ˵javascript×÷ΪһÖֽű¾ÓïÑÔ²»Í¬ÓÚÄÇÖÖÑϸñµÄÃæÏò¶ÔÏóµÄc++.c#,javaÁË.¾ßÓиü¸ßµÄÁé»îÐÔ.
*/
/*
ÔÚjavascript ......