I use window.onerror(message,url,line) to log my error messages because it gives me more debug information than try{}catch(e){}.
However, consider the following:
function1(); // Generates error
function2(); // Will not be executed
How can I ensure that function2 will fire while still using window.onerror?
In the meantime, I’ve found a way using
setTimeout, but I hope there might be a better way:See http://jsfiddle.net/7y2Ej/1/