

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How can I add debugging code to my JavaScript?
To add debugging code to JavaScript, use the alert() or document.write() methods in your program. For example,
var debugging = true; var whichImage = "widget"; if( debugging ) alert( "Calls swapImage() with argument: " + whichImage ); var swapStatus = swapImage( whichImage ); if( debugging ) alert( "Exits swapImage() with swapStatus=" + swapStatus );
Examine the content and order of the alert() as they appear, you can examine the health of your program very easily.
- Related Questions & Answers
- How can I add textures to my bars and wedges in Matplotlib?
- How can I curb my shopping addiction?
- How can I increase my monthly savings?
- How can I get my invention patented?
- How can I improve my spoken English?
- How can I remove dandruff from my hair?
- How can I make my layout scroll vertically?
- How can I make my custom objects Parcelable?
- How can I make my custom objects Serializable?
- How can I enhance my skin tone to look beautiful?
- Debugging JavaScript using Firebug
- How would I make destroy() method in Tkinter work with my code?
- How to change my code to uncheck radio button from JavaScript to jQuery?
- How do I add more members to my ENUM - type column in MySQL?
- How do I redirect my web page with JavaScript?
Advertisements