在Visual Studio 2005中进行Javascript的调试
1. 按Ctrl+S 健保存页面设计
2. 打开浏览器窗口
3. 单击浏览器中的【工具】——【Internet选项】——【高级】 ,打开选项卡,找到复选框“禁用脚本调式(Internet Explorer)“和”禁用脚本调试(其他)“,并 取消对其的选择。
4. 在要查看的变量前添加一句代码“debugger;“ ,比如:
var total;
for(var i=0; i<6: i++)
{
debugger;
total = total + i ;
}
for(var i=0; i<6: i++)
{
debugger;
total = total + i ;
}
5. 按F5健运行程序,光标停在debugger处,按F10逐步调试程序。