Lea Verou 20.04.2015

Idea: Extending native DOM prototypes without collisions

Przeczytaj oryginał

This article discusses the historical challenges of extending native DOM prototypes in JavaScript, including memory leaks and collisions. It proposes a solution where libraries add only one property to Element.prototype (e.g., 'yolo') and hang all methods off that property, similar to how global namespaces are managed, to minimize collision risks while working directly with DOM elements.

Idea: Extending native DOM prototypes without collisions

komentarzy

Brak komentarzy

Bądź pierwszy, który podzieli się swoimi myślami!

Rozszerzenie przeglądarki

Uzyskaj natychmiastowy dostęp do AllDevBlogs z przeglądarki

Tydzień

No top articles yet