问题描述
我正在更新我为Nintendo Wii构建的网站,我正在寻找调试应用程序的好方法。 Wii的浏览器(Opera 9.3的一个版本)没有任何类型的JavaScript控制台。我打算使用各种远程调试控制台解决方案之一(例如),但没有一个他们似乎工作。我怀疑这是因为某些不受支持的功能,但我无法弄清楚没有控制台或某种错误输出的情况。
I am updating a site that I've built for the Nintendo Wii, and am looking for a good way to debug the application. Wii's browser (a version of Opera 9.3) does not have any sort of JavaScript console. I was going to use one of the various remote debug console solutions (such as jsconsole.com), but none of them seem to work. I suspect the reason for this is some sort of unsupported functionality, but I cannot figure out what that is without a console or some sort of error output.
我所做的事情试过:
-
window.onerror
() - (适用于桌面设备) ,而不是在Wii上)
- (引用错误不会引发异常,不会抛出异常。
try
/catch
有效,但仅适用于我抛出的异常。) -
< body onerror =alert('ERROR !!!')/ >
- PhoneGap的远程调试器/ Weinre
window.onerror
(Not supported until Opera 11.6)- Overriding the
Error.prototype.toString
method (works on desktops, not on Wii) - Code that appears to wrap script in
try/catch
blocks (Exceptions aren't thrown for reference errors and what not.try
/catch
works, but only for exceptions I throw.) <body onerror="alert('ERROR!!!')" />
- PhoneGap's Remote Debugger / Weinre
是否有任何其他建议可以捕获整个页面的错误和未处理的异常?
Are there any other suggestions for catching errors and unhandled exceptions for an entire page?
推荐答案
您始终可以在调试代码中编程例如:
You could always program in the debugging code yourself, for instance:
try{
yourFunction();
}catch(e){
alert('yourFunction failed!');
}
这篇关于捕获Wii / Opera 9上的所有JavaScript错误/异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!