Javascript debug: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
<< [[Testing]]: [[Javascript]] | << [[Testing]]: [[Javascript]] | ||
methods / functions | == methods / functions == | ||
print message | |||
* [http://www. | * alert() Method: [http://www.w3schools.com/jsref/met_win_alert.asp Window alert() Method] | ||
* [http://stackoverflow.com/questions/323517/is-there-an-equivalent-for-var-dump-php-in-javascript Is there an equivalent for var_dump (PHP) in Javascript? - Stack Overflow] | |||
* | |||
* console.log() | * console.log() | ||
** {{Fx}}: [http://getfirebug.com/logging Firebug and Logging : Firebug], [http://ithelp.ithome.com.tw/question/10000465 利用Firebug的console功能作JavaScript偵錯 - iT邦幫忙::IT知識分享社群] for {{Fx}} {{exclaim}} not work for the [https://chrome.google.com/webstore/detail/firebug-lite-for-google-c/bmagokdooijbeehmkpknfglimnifench Firebug Lite for Google Chrome](tested version: 1.4.0.11967 ) | ** {{Fx}}: [http://getfirebug.com/logging Firebug and Logging : Firebug], [http://ithelp.ithome.com.tw/question/10000465 利用Firebug的console功能作JavaScript偵錯 - iT邦幫忙::IT知識分享社群] for {{Fx}} {{exclaim}} not work for the [https://chrome.google.com/webstore/detail/firebug-lite-for-google-c/bmagokdooijbeehmkpknfglimnifench Firebug Lite for Google Chrome](tested version: 1.4.0.11967 ) | ||
Line 17: | Line 11: | ||
** {{IE}} v.9: [http://msdn.microsoft.com/en-US/library/ie/gg589530(v=vs.85).aspx Using the F12 Tools Console to View Errors and Status (Windows)] / [http://msdn.microsoft.com/zh-tw/library/ie/gg589530(v=vs.85).aspx 使用 F12 工具主控台檢視錯誤和狀態 (Windows)] {{exclaim}} not {{IE}} v.8 | ** {{IE}} v.9: [http://msdn.microsoft.com/en-US/library/ie/gg589530(v=vs.85).aspx Using the F12 Tools Console to View Errors and Status (Windows)] / [http://msdn.microsoft.com/zh-tw/library/ie/gg589530(v=vs.85).aspx 使用 F12 工具主控台檢視錯誤和狀態 (Windows)] {{exclaim}} not {{IE}} v.8 | ||
* [http://blog.longwin.com.tw/2007/07/javascript_var_dump_2007/ Javascript var_dump function | Tsung's Blog] | * [http://blog.longwin.com.tw/2007/07/javascript_var_dump_2007/ Javascript var_dump function | Tsung's Blog] | ||
DOM | |||
* 如果是進行 DOM 操作,可以將選定的 DOM 元素標上顏色,確認有選到。 ex: using [http://api.jquery.com/addClass/ .addClass() | jQuery API Documentation] | |||
data type | |||
* [http://www.w3schools.com/jsref/jsref_isnan.asp isNaN() Function], [http://www.w3schools.com/jsref/jsref_isfinite.asp isFinite() Function], typeof variable | |||
== tools == | |||
* [http://www.javascriptlint.com/online_lint.php The Online Lint] | |||
* [http://www.jslint.com/ JSLint,The JavaScript Code Quality Tool] | |||
** desktop editor: [http://www.sublimetext.com/ Sublime Text] + package: JSLint<ref>[http://opensourcehacker.com/2012/04/12/jslint-integration-for-sublime-text-2/ JSLint integration for Sublime Text 2]</ref> | |||
* [http://jsbin.com/ JS Bin - Collaborative JavaScript Debugging] {{Gd}} allow to download | |||
Revision as of 15:53, 13 November 2013
<< Testing: Javascript
methods / functions
print message
- alert() Method: Window alert() Method
- Is there an equivalent for var_dump (PHP) in Javascript? - Stack Overflow
- console.log()
- Firefox : Firebug and Logging : Firebug, 利用Firebug的console功能作JavaScript偵錯 - iT邦幫忙::IT知識分享社群 for Firefox not work for the Firebug Lite for Google Chrome(tested version: 1.4.0.11967 )
- Chrome : Using the Console - Chrome Developer Tools — Google Developers
- IE v.9: Using the F12 Tools Console to View Errors and Status (Windows) / 使用 F12 工具主控台檢視錯誤和狀態 (Windows) not IE v.8
- Javascript var_dump function | Tsung's Blog
DOM
- 如果是進行 DOM 操作,可以將選定的 DOM 元素標上顏色,確認有選到。 ex: using .addClass() | jQuery API Documentation
data type
- isNaN() Function, isFinite() Function, typeof variable
tools
- The Online Lint
- JSLint,The JavaScript Code Quality Tool
- desktop editor: Sublime Text + package: JSLint[1]
- JS Bin - Collaborative JavaScript Debugging allow to download