Editing
Javascript debug
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Methods/Functions to Help with Debugging == Print message * alert() Method: [https://www.w3schools.com/jsref/met_win_alert.asp Window alert() Method] equivalent: window.alert("some message..."); * [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() ** {{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 ) ** {{Chrome}}: [https://developers.google.com/chrome-developer-tools/docs/console Using the Console - Chrome Developer Tools — Google Developers] Enter the javascript scripts in the console ( after the {{kbd | key = <nowiki>></nowiki>}} symbol) directly. * [http://blog.longwin.com.tw/2007/07/javascript_var_dump_2007/ Javascript var_dump function | Tsung's Blog] * [https://www.w3schools.com/js/js_json_stringify.asp JSON.stringify()][https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify] "Convert a JavaScript object into a string" {{access | date = 2017-09-11}} 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 Browser tool * [https://stackoverflow.com/questions/10213703/how-do-i-view-events-fired-on-an-element-in-chrome-devtools javascript - How do I view events fired on an element in Chrome DevTools? - Stack Overflow] on {{Chrome}} Browser cache issue * [https://stackoverflow.com/questions/44958022/managing-browser-cache javascript - Managing browser cache - Stack Overflow] * [https://blog.miniasp.com/post/2008/02/03/Avoid-browser-cache-problem-on-css-or-javascript-file.aspx The Will Will Web | 簡易克服 CSS 被瀏覽器快取(Cache)的問題]
Summary:
Please note that all contributions to LemonWiki共筆 are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
LemonWiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Current events
Recent changes
Random page
Help
Categories
Tools
What links here
Related changes
Special pages
Page information