Google¿ªÔ´JavaScript¹¤¾ß Closure
Google¿ªÔ´ÁËÆäÄÚ²¿Ê¹ÓõÄJavaScript¿ª·¢¹¤¾ßClosure£¬Ï£Íû°ïÖúÍⲿ³ÌÐòÔ±¿ª·¢³öËٶȸü¿ìµÄWebÓ¦ÓóÌÐò¡£GoogleÈÏΪͨ¹ýÔÊÐí¿ª·¢ÕßʹÓÃGoogle×Ô¼ºËùÓõŤ¾ß£¬ËûÃDz»½ö¿ÉÒÔ´´Ôì³ö¸ü¿ìµÄ¸»WebÓ¦ÓóÌÐò£¬¶øÇÒÄÜÕæÕýÈÃWeb²åÉϳá°ò¡£Closure JavaScript±àÒëÆ÷ºÍ¿âÔø±»GoogleÓÃÓÚ¿ª·¢Gmail¡¢Google Docs¡¢Google MapsÒÔ¼°ÆäËüÓ¦ÓóÌÐò¡£
Closure¹¤¾ß°üÀ¨ÁËJavaScriptÓÅ»¯Æ÷£¬ÒƳý²»ÐèÒªµÄ´úÂ룬ѹËõÆäÓàµÄ´úÂëÒÔʵÏÖËÙ¶È×î´ó»¯£»
ÓëFirebugÐͬ¹¤×÷µÄFirefoxÀ©Õ¹Closure Inspector£¬Ä¿µÄÊǼò»¯µ÷ÊÔ£»
Closure±àÒëÆ÷£¬ÄÜÒÔÃüÁîÐС¢WebÓ¦ÓûòFirefoxÀ©Õ¹ÐÎʽÔËÐУ»
Closure Library£¬GoogleµÄ±ê×¼JavaScriptÀà¿â£»
Closure TemplatesÌṩÁËÒ»×éÔ¤±àÒëµÄJavaScript½Ó¿Ú×é¼þ¡£
Ïà¹ØÎĵµ£º
scrollHeight: »ñÈ¡¶ÔÏóµÄ¹ö¶¯¸ß¶È¡£
scrollLeft:ÉèÖûò»ñȡλÓÚ¶ÔÏó×ó±ß½çºÍ´°¿ÚÖÐÄ¿Ç°¿É¼ûÄÚÈݵÄ×î×ó¶ËÖ®¼äµÄ¾àÀë
scrollTop:ÉèÖûò»ñȡλÓÚ¶ÔÏó×¶ËºÍ´°¿ÚÖпɼûÄÚÈݵÄ×¶ËÖ®¼äµÄ¾àÀë
scrollWidth:»ñÈ¡¶ÔÏóµÄ¹ö¶¯¿í¶È
offsetHeight:»ñÈ¡¶ÔÏóÏà¶ÔÓÚ°æÃæ»òÓɸ¸×ø±ê offsetParent ÊôÐÔÖ¸¶¨µÄ¸¸×ø±êµÄ¸ß¶È
offsetL ......
±¾²©¿ÍתÔØÓÚ£ºhttp://devbean.javaeye.com/blog/404040
»òÐíÄã»áÆæ¹Ö£¬ÃæÏò¶ÔÏóµÄ³ÌÐòÉè¼ÆΪʲô´ÓÊý×鿪ʼ½²Æð£¿ÕâÊÇÒòΪ……Æä¼äµÄÖÖÖÖ¹Øϵ°É……ºÙºÙ£¬ÕâÀïÏÈÂô¸ö¹Ø×Ó£¬ÏÈÀ´¿´¿´ÎÒÃÇÊìϤµÄÊý×éÔÚJavaScriptÀïÃæÊÇʲôÑù×ӵġ£
1. ´´½¨Êý×é
ÔÚJavaScriptÖÐÓкܶഴ½¨Ê ......
String¶ÔÏóµÄ charAt(x)¶ÔÏó ·´»ØÖ¸¶¨¶ÔÏóµÄµÚ¶àÉÙλµÄ×Öĸ
lastIndexOf("string") ´ÓÓÒµ½×óѯÕÒÖ¸¶¨×Ö·û£¬Ã»Óзµ»Ø-1
......
ÐÂÎÅÀ´Ô´:tripwiremagazine.com
JavaScript ÊÇ Web ¿ª·¢ÓëÉè¼ÆÖв»¿É»òȱµÄ¶«Î÷£¬²»¹ÜÊÇÒ»¸ö¼òµ¥µÄÍøÒ³»¹ÊÇÒ»¸öרҵµÄÕ¾µã£¬Ò²²»¹ÜÄãÊǸßÊÖ»¹ÊDzËÄñ£¬Èç½ñ
JavaScript ¿âÔ½À´Ô½Ç¿´ó£¬¿ÉÒÔʤÈÎÐí¶à¸´ÔӵŤ×÷£¬È»¶øͬʱ£¬ÈËÃÇÔÚÖÚ¶à JavaScript ¿âÃæÇ°ÓÖ¾õµÃÎÞËùÊÊ´Ó£¬±¾ÎÄ£¬ÎÒÃǽ«Ê¹ÓÃ
Google ËÑË÷³öÅÅÃûÇ° 10 λµ ......
±¨±íÕ¹ÏÖÔÚwebÒ³ÃæÒÔºó£¬ÓÐʱÐèÒª»ñȡijµ¥Ôª¸ñµÄÖµ¡£ÈóǬ±¨±íÖпÉÒÔͨ¹ýÔÚjspÒ³ÃæÖÐÉ趨JavaScriptº¯ÊýÀ´ÊµÏÖÕâ¸ö¹¦ÄÜ¡£ÏÂÃæ¾Íͨ¹ýÒ»¸öÏÂÀý×Ó¼òµ¥½éÉÜÒ»ÏÂÈçºÎͨ¹ýJavaScriptº¯Êý»ñÈ¡Web±¨±íµ¥Ôª¸ñµÄÖµ¡£
Ê×ÏÈ£¬½«·¢²¼±¨±íµÄjspÒ³ÃæÖеı¨±í±êÇ©<report:html>·ÅÔÚÒ»¸ö<table>±êÇ©ÖУ¬ÈçÏÂͼ
ÆäÖÐ<report:h ......