
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
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 Articles
- How can I add textures to my bars and wedges in Matplotlib?
- How can I organize my Python code to make it easier to change the base class?
- How to change my code to uncheck radio button from JavaScript to jQuery?
- How can I increase my monthly savings?
- How can I curb my shopping addiction?
- How can I improve my spoken English?
- How can I get my invention patented?
- How would I make destroy() method in Tkinter work with my code?
- How can I enhance my skin tone to look beautiful?
- How can I remove dandruff from my hair?
- How can I make my custom objects Parcelable?
- How can I make my custom objects Serializable?
- How can I make my layout scroll vertically?
- How can my code discover the name of an object in Python?
- How do I add more members to my ENUM - type column in MySQL?

Advertisements