开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜