JavaScriptµ÷ÊÔ¼¼ÇÉÖ®£º¶Ïµãµ÷ÊÔ
Ê×ÏÈ£¬ÔÚ¸÷¸öä¯ÀÀÆ÷ÖУ¬¶Ïµãµ÷ÊÔÖ§³ÖµÄ×îºÃµÄµ±È»ÊÇFirefox£¬Firefox²»½ö¿ÉÒÔʹÓÃFirebugµ÷ÊÔÒ³Ãæjs½Å±¾£¬»¹¿ÉÒÔÓø߼¶µ÷ÊÔ¹¤¾ßÀýÈçJavaScript Debugger (Venkman) À´µ÷ÊÔFirefoxÀ©Õ¹ÀïµÄjs¡£³ý´ËÖ®Í⣬Firefox»¹Ö§³ÖһЩ¸üΪ¸ß¼¶µÄ¶Ïµãµ÷ÊÔ¡¢±äÁ¿¼àÊÓ¹¦ÄÜ¡£
ÆäËûä¯ÀÀÆ÷ÀOpera¡¢ChromeºÍSafariµÄµ÷ÊÔ¹¦ÄÜÒ²±È½ÏºÃÓá£OperaµÄDragonFlyËÙ¶ÈÏà¶Ô±È½Ï¿ì£¬½çÃæÇåˬ£¬¹¦ÄÜÇ¿´ó£¬µ«²»ÈçSafariµÈÓѺá£Ïà±ÈÀ´Ëµ£¬IE8µÄ³ÌÐòÔ±¹¤¾ß¼òֱû·¨Óá£
Õâ´Îʱ¼äÓÐÏÞ£¬ÏÈÀ´×ܽáÒ»ÏÂFirefoxϵĵ÷ÊÔ¼¼ÇÉ¡£
1. ʹÓÃFirebug½øÐжϵãµ÷ÊÔ
ʹÓÃFirebugµ÷ÊÔJavaScript·Ç³£·½±ã¡£¾ßÌå²½Ö裺
a. ´ò¿ªFirebugºó£¬ÆôÓ᰽ű¾¡±µ÷ÊÔ£¬ÕÒµ½ÒýÓõĽű¾Îļþ£¨»òÕßÐÐÄÚjs£©£»
ÓÃFirebugÕÒµ½Òªµ÷ÊԵĽű¾£¨µã»÷·Å´ó£©
b. ÔÚÊʵ±µÄλÖüÓÈë¶Ïµã£»
c. Èç¹û¶ÏµãÒѾִÐйý£¬ÔòË¢ÐÂÒ³Ã棬Õâʱ½Å±¾¾Í»áÔڶϵ㴦Öжϡ£Èç¹û¶ÏµãûÓÐÖ´Ðйý£¬ÄÇ¿ÉÒÔÖ±½ÓÖ´ÐÐÒ³ÃæÉϵĶ¯×÷£¨ÀýÈçµã»÷°´Å¥µÈ£©£¬È»ºó´úÂë»áÔڶϵ㴦Öжϣ»
ÓÃFirebug½øÐжϵãµ÷ÊÔ£¨µã»÷·Å´ó£©
d. ¹Û²ìº¯Êýµ÷ÓÃÕ»£¬¹Û²ìlocal±äÁ¿£¬Ò²¿ÉÒÔ½øÐе¥²½Ö´ÐУ¬½øÐе÷ÊÔ¡£
ȷʵ·Ç³£¼òµ¥£¡ÓÃFirebug¶Ïµãµ÷ÊÔµÄÓŵã×ܽáÈçÏ£º
ÄܼӶϵãµÄÐÐÓÃÂÌÉ«Ðкţ¬·Ç³£Ö±¹Û£»
call stackÓÃÁ½ÖÖ·½Ê½ÏÔʾ³öÀ´£¬ºÜ·½±ã£»
±¾µØ±äÁ¿µÄÏÔʾ·Ç³£ÇåÎúÃ÷ÁË¡£
2. ʹÓÃJavaScript Debugger½øÐжϵãµ÷ÊÔ
ÕâÊÇÀÏÅƵĵ÷ÊÔ¹¤¾ß£¬Ö®Ç°½Ð×öVenkman£¬¿ÉÒÔÒÔÀ©Õ¹ÐÎʽ°²×°ÔÚFirefoxÉÏ£¬ÎÒÃÇÔÚÕâÀï¾Í³ÆËûΪVenkman°É¡£Ëü²»½öÄܹ»µ÷ÊÔÒ³Ãæ½Å±¾£¬»¹Äܵ÷ÊÔFirefoxÀ©Õ¹£¨extension£©ÀïµÄjs¡£ÎÒÃÇÔÚ×öFirefoxÀ©Õ¹¿ª·¢Ê±£¬VenkmanÊDZز»¿ÉÉٵŤ¾ß£¬ÀÏÌïÇ¿Á¦ÍƼö£¡µ±È»£¬Firefox±¾ÉíµÄÂ߼ʵÏÖ£¬Ò²ÊÇÓÃJavaScriptÀ´×öµ½µÄ¡£ÎÒÃÇÏÖÔÚ¿ÉÒÔÓÃVenkmanÀ´µ÷ÊÔÒ»ÏÂFirefox±¾Éí¡£FirefoxµÄºËÐÄjsÊÇbrowser.js£¬ÔÚÕâ¸ö·¾¶Ï£º
chrome://browser/content/browser.js
ÎÒÃÇ´ò¿ªVenkmanÖ®ºó£¬ÔÚLoaded ScriptsÀïÌîÈëbrowser.js£¬Õâ¸öjsÎļþ¾Í»á±»¹ýÂ˳öÀ´£¨Èç¹ûûÓп´µ½browser.js£¬ÄÇôÄã¿ÉÄÜÐèÒª²éÒ»ÏÂÊÇ·ñÑ¡ÉÏÁËDebug->Exclude browser files£©¡£
Venkman£ºÑ¡ÔñÒªµ÷ÊÔµÄjsÎļþ£¨µã»÷·Å´ó£©
ÎÒÃÇÕÒµ½ÈÃä¯ÀÀÆ÷ºóÍ˵ĴúÂ룬Ȼºóµã»÷FirefoxµÄºóÍË°´Å¥£¬ÕâʱVenkman¾Í»áÍ£ÔÚBrowserBack·½·¨ÉÏ£¡ÈÃÎÒÃÇÔÙÒ»²½Ò»²½µØ¿´Ò»¿´£¬Firefox×Ô¼ºµ½µ××öÁËʲô¡£btw£¬ÊµÏÖFirefoxµÄjs´úÂëÒ²²»ÊǺÜƯÁÁÂï~~~
ÓÃJavaScript Debugger¶Ïµãµ÷ÊÔFirefox£¨µã»÷·Å´ó£©
Venkm
Ïà¹ØÎĵµ£º
ûÕÒµ½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>
ÔÚ²»Ö§³Ö ......
ʹÓùýAJAX¼¼ÊõµÄÈ˶¼ÖªµÀ´óÃû¶¦¶¦µÄJQuery¡£ËäÈ»ÎÒÀ´Ñ§Ï°Ö®Ç°Óп´¹ýAJAXµÄÊÓƵ£¬µ«ÄÇʱ¶ÔWEBÓ¦ÓÃÕâ¸ö¶«Î÷»¹±È½ÏÄ£ºý£¬²»Çå³þHTML¡¢JSPÓëServletÊÇÔõô¹¤×÷µÄ£¬ÉõÖÁ²»ÖªµÀJQuery°ü×°µÄÊÇʲô¶«Î÷¡£½ñÈÕµÄѧϰÔÙ½áºÏ×òÌìµÄJavaScriptDOMµÄÄÚÈÝ£¬ÈÃÎÒ¶Ô´ËÊ®·ÖÇåÎú¡£JQueryÔÔò£º“write less, do more.” ......
ÒýÈëÃüÃû¿Õ¼ä֮ǰ£¬Ò»¸öÁ·¢ÈËԱͷÌÛµÄÎÊÌâ¾ÍÊÇÈçºÎ·ÀÖ¹º¯ÊýÃû/ÀàÃûºÍÆäËûÈ˵ijåÍ»£¬ÔÚÒ»¸ö¹«Ë¾ÄÚ²¿ÏîÄ¿×éÖ®¼ä¿ÉÒÔͨ¹ýÃüÃûÔ¤¶¨£¨±ÈÈç¼Óǰ׺
µÈ£©½â¾öÕâ¸öÎÊÌ⣬µ«ÊÇ°ÑÊÓÏ߷ŵ½Õû¸öÈí¼þ¿ª·¢ÁìÓò£¬ÔÚµ±½ñÐ×÷¿ª·¢Ï൱ʢÐеÄʱ´ú£¬Õâ¸öÎÊÌâÈ´ÒÀÈ»´æÔÚ¡£ÔÚʹÓöà¸öµÚÈý·½¿ò¼Ü»òÀà¿âµÄʱºò£¬ÄãΨһÄÜ×÷
µÄ¾ÍÊÇÆíµ»ËüÃǵÄÃüà ......
<script language="javascript">
String.prototype.gblen = function() {
var len = 0;
for (var i=0; i<this.length; i++) {
if (this.charCodeAt(i)>127 || this.charCodeAt(i) ......