ÔÚJavaScriptÖÐʵÏÖ¸ßЧµÄStringBuffer
JavaScriptÖеÄStringÊÇÖ»¶ÁµÄ£¬ËùÒÔÿ´Î¶ÔString±äÁ¿µÄ²Ù×÷¶¼»áÔÚÄÚ´æÖвúÉúÒ»¸öÁãʱ±äÁ¿£¬Èç¹ûÒª¶Ô×Ö·û´®½øÐдóÁ¿µÄÖØ¸´²Ù×÷£¬ÐÔÄܺÍЧÂʶ¼»áºÜµÍÏ£¬Òò´Ë³£ÓÃÊý×éµÄ·½·¨²Ù×÷×Ö·û´®£¬¼´ÏȰÑ×Ö·û´®¶¼´æ´¢ÔÚÊý×éÖУ¬È»ºóʹÓÃjoin()·½·¨Á¬½Ó×Ö·û´®¡£
µ±È»¿ÉÒÔ°ÑÕâÖÖ·½·¨ÔÙÑݱäһϣ¬ÔÚJavaScriptÖÐÄ£ÄâStringBufferÀà¡£
¿´Ò»Ï´úÂ룺
<script type="text/javascript">
function StringBuffer(){
this._Strings = new Array();
}
StringBuffer.prototype = {
append : function(str){
this._Strings.push(str);
},
toString : function(){
return this._Strings.join(",");
}
}
var myvar = new StringBuffer();
myvar.append("a");
myvar.append("b");
myvar.append("c");
myvar.append("d");
myvar.append("e");
alert(myvar.toString());
</script>
Ïà¹ØÎĵµ£º
scrollHeight: »ñÈ¡¶ÔÏóµÄ¹ö¶¯¸ß¶È¡£
scrollLeft:ÉèÖûò»ñȡλÓÚ¶ÔÏó×ó±ß½çºÍ´°¿ÚÖÐĿǰ¿É¼ûÄÚÈݵÄ×î×ó¶ËÖ®¼äµÄ¾àÀë
scrollTop:ÉèÖûò»ñȡλÓÚ¶ÔÏó×î¶¥¶ËºÍ´°¿ÚÖпɼûÄÚÈݵÄ×î¶¥¶ËÖ®¼äµÄ¾àÀë
scrollWidth:»ñÈ¡¶ÔÏóµÄ¹ö¶¯¿í¶È
offsetHeight:»ñÈ¡¶ÔÏóÏà¶ÔÓÚ°æÃæ»òÓɸ¸×ø±ê offsetParent ÊôÐÔÖ¸¶¨µÄ¸¸×ø±êµÄ¸ß¶È
offsetL ......
ÓÐÁ½ÖÖÍøÒ³Éè¼ÆÕߣºÏ²»¶Óÿò¼Ü(Frame)µÄºÍ²»Ï²»¶µÄ¡£²»Ï²»¶Ê¹Óÿò¼ÜµÄÈËÃÇ×ÜÊDZ§Ô¹Ëµ£¬¿ò¼ÜʹµÃÒ³Ãæ±äµÃ¸´ÔÓ£¬Ôö¼ÓÁËÏÂÔØ¸ºµ££¬¶øÇÒ»á¼õÉÙÄãµÄÒ³Ãæ±»ËÑË÷ÒýÇæÕÒµ½µÄ»ú»á¡£¶øÏ²»¶¿ò¼ÜµÄÉè¼ÆÕßÔò˵¿ò¼Üʹä¯ÀÀ±äµÃ¼òµ¥£¬²¢¸³ÓèÉè¼ÆÈËÔ±ÔÚ°²ÅÅÒ³ÃæÉϸü¶àµÄ¿ØÖÆ¡£
¡¡¡¡²»¹ÜÄãÊÇÔÞ³ÉʹÓÿò¼Ü»¹ÊÇ·´¶Ô£¬ÊÂʵÉÏ£¬´ø¿ò¼ÜµÄÒ³ÃæÒ»Ö±´ ......
ûÕÒµ½vs2008½«JavaScriptÅŰæµÃºÃ¿´Ð©µÄ°ì·¨£¬µ«ÓÐÕâ¸ö¹¤¾ß
http://jsbeautifier.org/
ÕâÊÇÀÏÍâµÄÒ»¸öÔÚÏßÅŰæJavaScriptµÄ·þÎñ¡£
ÎÒ²»Ï²»¶ÏÂÔØ°²×°Ò»Ð©²»Ì«”Õý“µÄÈí¼þ¹¤¾ß¡£
==
˳±ãÔÞÒ»ÏÂCSDN²©¿ÍµÄ"ÔÝ´æÏä"¹¦ÄÜ¡£
µ«ÔÚÎÒ·¢ÁË”ADSL80¶Ë¿Ú“Ò»ÎÄ£¬ÔÚ½ÓÏÂÀ´µÄÊ®À´·ÖÖÓÁË£¬Ð޸IJ»ÁË£¬Ò²²»ÄÜ ......
JavaScript·½·¨ºÍ¼¼ÇÉ´óÈ« »ù´¡ÖªÊ¶
1 ´´½¨½Å±¾¿é <script language=”JavaScript”> JavaScript code goes here </script>
2 Òþ²Ø½Å±¾´úÂë <script language=”JavaScript”><!-- document.write(“Hello”); --> </script>
ÔÚ²»Ö§³Ö ......