MyEclipse DeBug對JS腳本的功能淺析
MyEclipse DeBug對JS(JavaScript)腳本的功能。
使用JS時,大多用來操作DOM與DHTML對象與元素,因此JS運行,需要Browser環(huán)境支持。
所以對 .js 文件的調(diào)試,只需將其引入執(zhí)行頁面中,即可啟動MyEclipse DeBug的功能。
例如:
MyEclipse DeBug使用1、rhino.js 文件內(nèi)容如下:
var str = "HelloWorld" ;
alert(str);
MyEclipse DeBug使用2、rhino.html 文件內(nèi)容如下:
- ﹤!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"﹥
- ﹤html﹥
- ﹤head﹥
- ﹤meta http-equiv="Content-Type" content="text/html; charset=UTF-8"﹥
- ﹤title﹥Rhino JavaScript For Java﹤/title﹥
- ﹤script Language="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狀態(tài)
【編輯推薦】