![]()
JavaScript Debugging
Techniques for debugging JavaScript include the following:
- Analyze and correct any reported JavaScript errors and warnings.
- Instrument scripts with alert( ) functions to examine values and expose execution paths at runtime.
- Instrument scripts to log debug information to the Java system console. You can use LiveConnect technology to execute Java methods directly from JavaScript. For example, assuming the appropriate security manager settings are in place, you can type the following:
javascript:java.lang.System.out.println('Hello World!');- Use javascript:xxx in the location field to execute JavaScript dynamically at runtime. For example, type javascript:debug(document.rootNode.outerHTML); in the location field to cause the current HTML document to be displayed on the screen, or logged to a file if the ice.debug.file system property is defined. This can be useful, for example, for examining or changing the state of JavaScript global variables at runtime, or for executing JavaScript functions dynamically to see if they are having the intended effect.
Note that an integrated JavaScript debugger is not yet supported.
|
Copyright 2005. ICEsoft Technologies, Inc. http://www.icesoft.com |