javascript - why is overriding window.onresize bad practise? -


refering javascript window resize event

they mentioned solution add listener window "resize" event , said overriding window.resize bad practise...

my question why?

the same applies events: using .onsomething = function() {...} assignment, , overwrite existing event handler, can bugger other pieces of code.

addeventlistener, on other hand, add new event handler without affecting existing ones.

one thing watch out i've seen numerous cases same event handler gets repeatedly added due bad code, whereas using .onsomething = ... avoid problem.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -