问题
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.
Things I've tried:
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?
回答1:
this link was suggestting lookimng into firebug lite. I don't know how it would fare on the wii browser as I don't own the device.
It's a pity that the engine is too old for supporting draagonfly.
回答2:
You could always program in the debugging code yourself, for instance:
try{
yourFunction();
}catch(e){
alert('yourFunction failed!');
}
来源:https://stackoverflow.com/questions/12664434/catching-all-javascript-errors-exceptions-on-wii-opera-9