In my javascript logging framework,I am catching unhandled exceptions through window.onerror handler.
How could I check for whether window.onerror is available or not.since in few browsers it would not recognize window.onerror.
You can check with :
if(typeof window.onerror === 'undefined'){
// you can't use window.onerror
}else{
//you can
}
Check out the MDN docs for a headstart on how you might override or create some kind of polyfill that would work cross browser: