I have a phonegap application that throws a javascript error. I had an HTML page open in a browser on my desktop, and it works fine there without errors. When I load it into the android emulator, the window.onerror event is fired, but I do not see any useful information in the error object to find out where it came from. I have this to try to get more from the error object:
window.onerror = function(e){ for(var i in e){ console.log("window.onerror ::" + i + ' = ' + e[i]); } };
But I donβt even see the message property. Here's the conclusion:
window.onerror ::undefined window.onerror ::eventPhase = 3 window.onerror ::currentTarget = [object DOMWindow] window.onerror ::cancelable = false window.onerror ::target = [object HTMLScriptElement] window.onerror ::bubbles = true window.onerror ::type = error window.onerror ::cancelBubble = false window.onerror ::clipboardData = undefined window.onerror ::srcElement = [object HTMLScriptElement] window.onerror ::defaultPrevented = false window.onerror ::timeStamp = 1330975112077 window.onerror ::returnValue = true window.onerror ::stopPropagation = function stopPropagation() { [native code] } window.onerror ::preventDefault = function preventDefault() { [native code] } window.onerror ::initEvent = function initEvent() { [native code] } window.onerror ::stopImmediatePropagation = function stopImmediatePropagation() { [native code] } window.onerror ::CAPTURING_PHASE = 1 window.onerror ::AT_TARGET = 2 window.onerror ::BUBBLING_PHASE = 3 window.onerror ::MOUSEDOWN = 1 window.onerror ::MOUSEUP = 2 window.onerror ::MOUSEOVER = 4 window.onerror ::MOUSEOUT = 8 window.onerror ::MOUSEMOVE = 16 window.onerror ::MOUSEDRAG = 32 window.onerror ::CLICK = 64 window.onerror ::DBLCLICK = 128 window.onerror ::KEYDOWN = 256 window.onerror ::KEYUP = 512 window.onerror ::KEYPRESS = 1024 window.onerror ::DRAGDROP = 2048 window.onerror ::FOCUS = 4096 window.onerror ::BLUR = 8192 window.onerror ::SELECT = 16384 window.onerror ::CHANGE = 32768
What else can be done to find the problem?
source share