JavaScript
  Home arrow JavaScript arrow Debugging in Javascript
IBM developerWorks
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Dedicated Servers  
Actuate Whitepapers 
Moblin 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
JAVASCRIPT

Debugging in Javascript
By: Chris Root
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 21
    2005-02-16

    Table of Contents:
  • Debugging in Javascript
  • The Hard Way
  • Using Comments
  • Are We There Yet?
  • Make a Log Window

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Debugging in Javascript


    (Page 1 of 5 )

    Despite its widespread use, there is little support for debugging in Javascript. When scripts get complicated, the debugging process can cause even the most patient programmer to pull out their hair in frustration. Chris Root offers several tools and techniques that just might keep you from going prematurely bald during the debugging process.
     
    Javascript is a very widely used scripting language. In fact the ECMA (European Computer Manufacturers Association) script standard on which Javascript is based is in even wider use. Some ECMA script based APIs include CFScript (Cold Fusion), Actionscript (Flash) and JScript. In addition, many products such as Adobe Acrobat use embedded Javascript engines for automation of application actions.

    Curiously however, unlike many well known programming languages, debugging and IDE support has been lacking.

    In terms of the Javascript API used by Web browsers, this is at least somewhat understandable. Because of the way websites and applications use Javascript, having the user interface "live" at the time of debugging is usually mandatory to allow scripts to work. Most scripts interact heavily with the user interface and the user. Add to that the complexity of cross browser code that no other programming language has to deal with, and you have a unique problem on your hands.

    Though it is possible to generate user interfaces programatically with Javascript, it is of course normally done with a separate HTML file that would need to be rendered. The best place to do all this is in the browser.

    Venkman

    If you have the newest version of Mozilla you can utilize a tool called Venkman. It is a Mozilla extension that provides a full blown debugger environment with variable monitoring, break points and many other features seen in debuggers from other languages.

    Venkman in conjunction with Mozilla isn't really a complete IDE like Visual Basic or Delphi, but it's as close as it gets. if you're curious and want to try Venkman go to the Venkman project home page and also try a Google search for "using venkman." You'll find all the information you need to get started.

    More JavaScript Articles
    More By Chris Root


       · Welcome everyone. Thank you for reading the article.
       · Good article. The popup window with updating values is a great way to watch the...
       · log4javascript (http://www.timdown.co.uk/log4javascript) has excellent pop-up...
       · I was having problems debugging a problem, that only happened on a live site - the...
       · Think I forgot to supply the link... doh! ;-)Here it is:...
       · You say one should name the file for the log window "dialog.html", but you're using...
     

    JAVASCRIPT ARTICLES

    - Detect Browser Compatibility with the Reques...
    - Using the EXT JS Date Picker Widget
    - Ajax Hack for Entering Information Without R...
    - EXT JS 2.1 Overview
    - Using the Style Object for Zebra Tables with...
    - Binary Searching
    - An Improved Approach to Building Zebra Tables
    - Assigning Background Colors Dynamically to Z...
    - Building Zebra Tables with CSS and JavaScript
    - JavaScript: Array Objects
    - A Closer Look at Smart Markers with Yahoo! M...
    - Using Polylines and Smart Markers with Yahoo...
    - Bulleted Menu of Links
    - Creating Click Loggers and Basic Markers wit...
    - Adding Pan Controls to Yahoo! Maps







    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway