handling javascript object existence checks globally
My JS developers always miss checking the object existence causi开发者_如何学Pythonng doucument.getElementByID is null problem. is there a way to handle this globally than adding the check for every single object. or is it possible to handle/suppress it during runtime?
Beat your developers with a "Javascript for Dummies" book and then make them go back and fix their code.
Seriously.
Error suppression can seem like a good thing at first, but it'll haunt you later down the road.
Suppress all errors:
window.onerror = function(){return true;};
But you may want to really should handle errors in a more decent fashion.
精彩评论