yEclipse DeBug对JS(JavaScript)脚本的功能。
使用JS时,大多用来操作DOM与DHTML对象与元素,因此JS运行,需要Browser环境支持。
所以对 .js 文件的调试,只需将其引入执行页面中,即可启动MyEclipse DeBug的功能。
例如:
MyEclipse DeBug使用1、rhino.js 文件内容如下:
var str = "HelloWorld" ;
alert(str);
MyEclipse DeBug使用2、rhino.html 文件内容如下:
- ﹤!DOCTYPEhtmlPUBLIC"-//W3C//DTDHTML4.01Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"﹥
- ﹤html﹥
- ﹤head﹥
- ﹤metahttp-equiv="Content-Type"content="text/html;charset=UTF-8"﹥
- ﹤title﹥RhinoJavaScriptForJava﹤/title﹥
- ﹤scriptLanguage="JavaScript"src="rhino.js"﹥﹤/script﹥
- ﹤/head﹥
- ﹤body﹥﹤/body﹥
- ﹤/html﹥
MyEclipse DeBug使用3、点击 Debug As ﹥﹥ JavaScript Application 进入 MyEclipse Web2.0 Browser 视窗
在 Address 栏 输入 rhino.html 的访问路径 如:http://localhost:8080/Rhino/rhino.html 即可进入MyEclipse DeBug状态