1. Javascript Debug Toolkit Introduction
JSDT (JavaScript debug Toolkit) is an Eclipse plug-in for JavaScript debugging that is used to debug JavaScript. JSDT can be debugged across browsers, supporting debugging JavaScript in mainstream browsers such as Ie,firefox,safari,chrome. JSDT supports the basic characteristics of debugging tools such as setting breakpoints, stepping debugging, and so on. 2. How to install
JSDT is developed based on the Eclipse3.2+,jdk1.5+ Foundation, so jdk1.5+ and eclipse3.2+ should be installed before installing JSDT. JSDT Download Address: http://code.google.com/p/jsdt/downloads/list, which jsdt-1.0. . zip is a JSDT installation package that extracts three of these jar packages into Eclipse's plugins directory and restarts Eclipse. The main problem that the current version solves is coding, using the technique of automatic detection coding to solve the coding problem. Jsdt-simple.swf is a video of a simple example of using JSDT to debug JavaScript in a Chrome browser. JSDT-EXT-DESKTOP.SWF is a video that uses JSDT to debug JavaScript in a Safari browser.
3. How to use 1. Open the Debug dialog box in Eclipse
As shown in the following illustration:
2. Create a new JavaScript Debug
Note: You cannot have Chinese characters in the URL path
As shown in the following figure, enter the url--local file name to be debugged or the file name on the server in the URL (only URLs of HTTP types are supported). Select the browser (Ie,firefox,safari or chrome, etc.) in the browser input box
After clicking and debugging, the browser opens, and Eclipse also turns to debug view and opens all the JavaScript files used.
If the JavaScript file is not open, check to see if the debug scripts view is turned on in the debugging perspective
If the view is not open, click: window-show view-other->debug scripts Open the Debug Scripts view, and then select the current debug stack to see the Debug Scripts view, double-click the debug File in scripts, you can open the script file.
3. Set Breakpoints
Breakpoints can be set in the JS file
When running to this line of JS in the browser, eclipse will stop at the breakpoint and wait for user action.
4. Other Operations
Because other operations are the same as Eclipse debugging, there is no more to say here.
JSDT Official website: http://code.google.com/p/jsdt/
Of course, the use of Firefox friends can also choose FireBug, but also very good JS debugging tools. Test code: Create file Test.html file:
<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd" >
To create a transform.js file:
function Add () {
var a = 3;
var b = 4;
Alert ("Hello");
}
A breakpoint can be added to a method at run time. Original address: http://blog.csdn.net/shine0181/article/details/7195906