JavaScriptÓï·¨¼¯½õ£¨¶þ£©
function function xx(){...} ¶¨Ò庯Êý
isNumeric ÅжÏÊÇ·ñÊÇÊý×Ö
innerHTML xx=¶ÔÏó.innerHTML ÊäÈëij¶ÔÏó±êÇ©ÖеÄhtmlÔ´´úÂë
innerText divid.innerText=xx ½«ÒÔdiv¶¨Î»ÒÔidÃüÃûµÄ¶ÔÏóÖµÉèΪXX
location.reload(); ʹ±¾Ò³Ë¢Ð£¬target¿ÉµÈÓÚÒ»¸öˢеÄÍøÒ³
Math.random() Ëæ»úºÊý,Ö»ÄÜÊÇ0µ½1Ö®¼äµÄÊý,Èç¹ûÒªµÃµ½ÆäËüÊý,¿ÉÒÔΪ*10,ÔÙÈ¡Õû
Math.floor(number) ½«¶ÔÏónumberתΪÕûÊý£¬ÉáÈ¡ËùÓÐСÊý
Math.min(1,2) ·µ»Ø1,2ÄĸöС
Math.max(1,2) ·µ»Ø1,2Äĸö´ó
navigator.appName ·µ»Øµ±Ç°ä¯ÀÀÆ÷Ãû³Æ
navigator.appVersion ·µ»Øµ±Ç°ä¯ÀÀÆ÷°æ±¾ºÅ
navigator.appCodeName ·µ»Øµ±Ç°ä¯ÀÀÆ÷´úÂëÃû×Ö
navigator.userAgent ·µ»Øµ±Ç°ä¯ÀÀÆ÷Óû§´ú±êÖ¾
onsubmit onsubmit="return(xx())" ʹÓú¯Êý·µ»ØÖµ
opener opener.document.¶ÔÏó ¿ØÖÆÔ´ò¿ª´°Ìå¶ÔÏó
prompt xx=window.prompt("ÌáʾÐÅÏ¢","Ô¤¶¨Öµ"); ÊäÈëÓï¾ä
parent parent.¿ò¼ÜÃû.¶ÔÏó ¿ØÖÆ¿ò¼ÜÒ³Ãæ
return return false ·µ»ØÖµ
random Ëæ»ú²ÎÊý£¨0ÖÁ1Ö®¼ä£©
reset() form.reset(); ʹform±íµ¥ÄÚµÄÊý¾ÝÖØÖÃ
split("") string.split("") ½«string¶ÔÏó×Ö·ûÒÔ¶ººÅ¸ô¿ª
submit() form¶ÔÏó.submit() ʹform¶ÔÏóÌá½»Êý¾Ý
Ïà¹ØÎĵµ£º
Javascript
ÊÇÒ»¸öºÜÇ¿´óºÜÁé»îµÄÓïÑÔ£¬Äã¼È¿ÉÒÔ°ÑËüµ±×÷ÃæÏò¹ý³ÌµÄÓïÑÔ£¬Ò²¿ÉÒÔ°ÑËüµ±×÷ÃæÏò¶ÔÏóµÄÓïÑÔÀ´Óá£ÕâÆªÖ÷Ҫ̽ÌÖÒ»ÏÂÈçºÎÓÃjavascriptÀ´ÊµÏÖÒ»¸ö
SingletonÀà¡£ÏàÐÅÓÐЩ±à³Ì¾ÑéµÄÅóÓÑÃǶÔSingletonģʽ¶¼ºÜÊìϤ¡£Singleton
ģʽÖ÷ÒªÓÃÀ´ÏÞÖÆÒ»¸öÀàµÄ¶à´ÎʵÀý»¯¡£Ò»°ãÀ´ËµÏµÍ³´´½¨µÄʵÀýÔ½ÉÙ£¬Õ¼ÓÃ×ÊÔ´Ô ......
1.×Ôhttp://jorkin.reallydo.com/article.asp?id=275
µÚÒ»´Î·¢ÏÖJavaScriptÖÐreplace() ·½·¨Èç¹ûÖ±½ÓÓÃstr.replace("-","!") Ö»»áÌæ»»µÚÒ»¸öÆ¥ÅäµÄ×Ö·û.
¶østr.replace(/\-/g,"!")Ôò¿ÉÒÔÈ«²¿Ìæ»»µôÆ¥ÅäµÄ×Ö·û(gΪȫ¾Ö±êÖ¾)¡£
replace()
The replace() method returns the string that results when you replac ......
JavaScript eval() º¯Êý
¶¨ÒåºÍÓ÷¨
eval() º¯Êý¿É¼ÆËãij¸ö×Ö·û´®£¬²¢Ö´ÐÐÆäÖÐµÄµÄ JavaScript ´úÂë¡£
Óï·¨
eval(string)
²ÎÊýÃèÊö
string
±ØÐè¡£Òª¼ÆËãµÄ×Ö·û´®£¬ÆäÖк¬ÓÐÒª¼ÆËãµÄ JavaScript ±í´ïʽ»òÒªÖ´ÐеÄÓï¾ä¡£
·µ»ØÖµ
ͨ¹ý¼ÆËã string µÃµ½µÄÖµ£¨Èç¹ûÓеϰ£©¡£
˵Ã÷
¸Ã·½·¨Ö»½ÓÊÜÔʼ×Ö·û´®×÷Ϊ² ......
JavaScript ÊÇ Web ¿ª·¢ÓëÉè¼ÆÖв»¿É»òȱµÄ¶«Î÷£¬²»¹ÜÊÇÒ»¸ö¼òµ¥µÄÍøÒ³»¹ÊÇÒ»¸öרҵµÄÕ¾µã£¬Ò²²»¹ÜÄãÊǸßÊÖ»¹ÊDzËÄñ£¬Èç½ñ
JavaScript ¿âÔ½À´Ô½Ç¿´ó£¬¿ÉÒÔʤÈÎÐí¶à¸´ÔӵŤ×÷£¬È»¶øÍ¬Ê±£¬ÈËÃÇÔÚÖÚ¶à JavaScript ¿âÃæÇ°ÓÖ¾õµÃÎÞËùÊÊ´Ó£¬±¾ÎÄ£¬ÎÒÃǽ«Ê¹ÓÃ
Google ËÑË÷³öÅÅÃûǰ 10 λµÄ JavaScript ¿â£¬²¢¶ÔËüÃÇÖðÒ»½øÐнéÉÜ ......
±¾²©¿Í×ªÔØÓÚ£ºhttp://devbean.javaeye.com/blog/409566
±Õ°üÕâ¸ö¸ÅÄî¿´ÉÏÈ¥ºÜÉî°Â£¬Õâ¸ö´ÊÔÚÀëÉ¢ÊýѧÀïÃæµÄÒâ˼ȷʵ±È½ÏÄÑÓÚÀí½â¡£ÔÚÕâÀÎÒÃÇÏÈ¿ÉÒ԰ѱհüÀí½â³ÉÊÇÒ»ÖÖÄäÃûº¯Êý»òÕßÄäÃûÀà¡£
1. ʲôÊDZհü£¿
ʲôÊDZհü£¿Ò»ÖÖÕýʽµÄ½âÊÍÊÇ£ºËùν±Õ°ü£¬Ö¸µÄÊÇÒ»ÖÖÓµÓкܶà±äÁ¿²¢ÇÒ°ó¶¨ÁËÕâЩ±äÁ¿µÄ»·¾³µÄ±í´ïÊ ......