InfoPath 2003的js看起来让人发疯, 想调试~~~,直接按F5出来一大堆的乱码,郁闷了吧!问过些人都没有解决!今天终于让我google到了解决方案了, ^_^
其实只要在OnLoad的事件里面添加debugger语句就OK了。
1. 打开 Tool - Programming - On Load Event
2. 在OnLoad事件中添加:
function
XDocument::OnLoad(eventobj)
{
debugger;
XDocument.UI.Alert("only for test");
}
{
debugger;
XDocument.UI.Alert("only for test");
}
3. 保存并预览
4. 在弹出的 Just-In-Time Debugging对话框中, 选择 New Instance of Microsoft Script Editor ,然后单击YES按钮 ;然后弹出一个 Attach to Process窗口,单击YES按钮。并可设置断点调试了~~