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

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

¼ÌÐøÉÏÒ»²¿·Ö£¬ÏÖÔÚÎÒÃǵÄʵµÄ¹¹ÔìÆ÷initializeºÜÍêÃÀÁË£¬ÉõÖÁÁ¬ÀàʽsuperÕâÑùÓï·¨ÌǶ¼²»ÓÃÁË£¬¾Í×Ô¶¯ÊµÀýÁ˸¸Àà¡£ÎÒÃÇת¶ø¿´Ò»¿´ÆäÊôÐÔÓë·½·¨µÄ¼Ì³Ð¡£Ðí¶àÀà¿â¶¼ÊÇÒ»¸öfor...inÑ­»·ÔÙ¼ÓһЩÅж¨ÊµÏÖÔ­ÐÍÊôÐÔ¿½±´£¬»ò¸ù¾ÝÕâЩÅж¨°ÑijЩÊôÐÔ¾¾³öÀ´¼Ó¹¤Ò»ÏÂÔٷŽøÈ¥¡£ÓÖÈ磬ÎÒÃÇÒª¶ÔArrayµÄÄ£°å½øÐÐÀ©Õ¹£¬×ö³ÉÒ»¸öÐÂÀàArray2£¬Ö±½Ó¼Ì³Ðºó£¬ÔÚÓÐЩä¯ÀÀÆ÷ÖÐArray2¿ÉÄÜÓÐforEach·½·¨£¬¿ÉÄÜûÓУ¬Èç¹ûûÓУ¬ÎÒÃDzÅÌí¼Ó×Ô¼ºÊµÏÖµÄforEach·½·¨¡£Òò´ËÌõ¼þ¹ýÂ˷dz£ÖØÒªµÄ¡£ÔÚmootoolsÖУ¬Éú³ÉÀ඼´øÓÐһЩÀà·½·¨£¨aliasÓëimplement£©£¬ÒÔ¹©¸ü½øÒ»²½µÄ¼Ó¹¤¡£
var copy = function(a,b,c){
var l = arguments.length;
if(a && b && l == 2){
for(var p in b)
a[p] = b[p];
}else if(a && b && l == 3 ){
a[b] = c;
}
return a;
};
ÉÏÃæµÄ·½·¨Ãû¸±Æäʵ£¬¾ÍÊÇÓÃÓÚµ¥´¿µÄ¸´ÖÆ¡£
var override = function(a,b,filter,scope){
var i, scope = scope || window;
for(i in b) {
if(filter.call(i,a,b))
a[i] = b[i];
}
};
override ΪÓÐÑ¡ÔñµØ¸´ÖÆ£¬Èç¹ûÎÒÃDz»Ï븲¸ÇÔ­Éúº¯Êý£¬Ö»ÐèÒªÕâÑù£º
override(Array,{/**/},function(p,a,b){
return !(p in a)
})
ÓÐÁËÒÔÉÏ·½·¨£¬ÎÒÃǾͿÉÒÔÉèÖøüΪ¸´ÔÓµÄÓï·¨ÌÇ£¬ÈçʵÀýÊôÐÔµÄgetterÓësetter£¬ËüÃÇÔÚjavaÔçÒÑÓÃannotation¸ã¶¨ÁË£¬ÔÚrubyÖÐËüÃǵÄÉèÖÃÒ²·Ç³£¼òµ¥£¬ÎÒÃÇûÓеÀÀí·ÅÆúÈç´ËÓÕÈ˵Ķ«Î÷¡£²»¹ý£¬ÔÚjavascriptÖÐÎÒÃÇÎÞ·¨ÀûÓÃ×¢ÊÍÀ´ÊµÏÖ£¬ÒòΪ¿ÉºÞµÄ»ðºüÔÚ±àÒëʱ°Ñ×¢ÊÍÈ«²¿È¥µô¡£rubyÄÇÖÖʵÏÖ£¬Ï൱ÓÚÈÃÈËÉè¼ÆÁíÒ»Ì×Óï·¨¡£Òò´Ë£¬ÎÒÃÇ»¹Êǽ»ÓÉÀ๤³§ÊµÏÖ£¬°ÑËüÃÇÈ«²¿±ä³ÉÔ­ÐÍ·½·¨¡£¹ý³ÌÈçÏ£¬Ê×ÏÈÈ¡µÃÎÒÃǶ¨ÒåµÄ¹¹Ôì·½·¨£¬È»ºóÈ¡µÃÆä²ÎÊý£¬ÔÙÈ¡µÃ¸¸À๹ÔìÆ÷µÄ²ÎÊý£¬È»ºóת»¯ÎªÁ½¸öÊý×飬Èç¹û×ÓÀà²ÎÊýÊý×éµÄ³¤¶È´óÓÚ¸¸ÀàµÄ£¬ËµÃ÷Ëü¶¨ÒåÁËеÄÊôÐÔ£¬ÎÒÃÇ°ÑÕâЩÐÂÊôÐÔÌá³öÀ´£¬È»ºó°ÑËüÃÇÊ××Öĸ´óдǰÃæ¼ÓÉÏsetÓëget£¬¶ÔÓ¦µÄº¯ÊýÓÃevalÉú³É¼´¿É¡£
//»ñÈ¡º¯ÊýµÄ²ÎÊý£¬ÒÔ×Ö·û´®Êý×éÐÎʽ·µ»Ø
var argumentNames = function(fn) {
var names = fn.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1]
.replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g, '')
.replace(/\s+/g, '').split(',');


Ïà¹ØÎĵµ£º

ÉîÈë½âJavaScriptº¯Êý

JavaScriptº¯ÊýÓï·¨
º¯ÊýÊǽøÐÐÄ£¿é»¯³ÌÐòÉè¼ÆµÄ»ù´¡£¬±àд¸´ÔÓµÄAjaxÓ¦ÓóÌÐò£¬±ØÐë¶Ôº¯ÊýÓиüÉîÈëµÄÁ˽⡣javascriptÖеĺ¯Êý²»Í¬ÓÚÆäËûµÄÓïÑÔ£¬Ã¿¸öº¯ Êý¶¼ÊÇ×÷Ϊһ¸ö¶ÔÏó±»Î¬»¤ºÍÔËÐеġ£Í¨¹ýº¯Êý¶ÔÏóµÄÐÔÖÊ£¬¿ÉÒԺܷ½±ãµÄ½«Ò»¸öº¯Êý¸³Öµ¸øÒ»¸ö±äÁ¿»òÕß½«º¯Êý×÷Ϊ²ÎÊý´«µÝ¡£ÔÚ¼ÌÐø½²Êö֮ǰ£¬ÏÈ¿´Ò»Ïº¯ÊýµÄ ʹÓÃÓï·¨£º ......

JavaScript checkboxÈ«Ñ¡ÓëÈ«²»Ñ¡µÄÇл»

  function select_all(){
var paras = document.getElementsByTagName("input");//È«Ñ¡checkbox
if(document.getElementById("all").checked==true){
for(var i=0; i<paras.length; i++){
var name = paras[i].getAttribute("name") //µ¥Ñ¡checkboxµÄname¾ùd ......

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

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

var isNumber ......

javascript ×Ö·û´®µÄ³Ë·¨

 ÔÚrubyÖÐÎÒÃÇ¿ÉÒÔͨ¹ý"*"²Ù×÷·ûÈ¥×Ö·û´®½øÐб¶Ôö£¬Èç"ruby"*2Ôò·µ»Ø"rubyruby"¡£ÔÚjavascriptÖУ¬×Ö·û´®Ö»ÄÜÓüӺţ¬Â³Ë·¨Ò²¼Ó·¨Ñݱä¹ýÀ´µÄ¡£ÎÒÃÇ¿ÉÒÔ¸ãÒ»¸öÊÔÊÔ¡£
·½·¨Ò»
  String.prototype.times = function(n) {//IE6 530-640 FF3 400~550 IE8 840 ~1110   chrome 600~1000
  &nb ......

javascriptС¼¼ÇÉ

 IE7²»¾­Ìáʾ¹Ø±Õä¯ÀÀÆ÷´°¿Ú
<a href="javascript:window.open('','_top'); window.top.close();">Close IE7</a>
----------------------------
ÓÃwindow.open·½·¨´ò¿ªÐ´°¿ÚÏÔʾÌáʾÐÅÏ¢
ÓÐʱºòÎÒÃÇÐèÒª´ò¿ªÒ»¸öд°¿ÚÓÃÀ´ÏÔʾÌáʾÐÅÏ¢
Õâ¸ö×ÔÈ»»áÏëµ½ÓÃwindow.open()·½·¨
µ«Ð´°Ì ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ