KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Would the following piece of code create a memory leak. According to the jQuery documentation use of the data function avoids memory leaks. It would be useful to confirm whether the following is safe. var MyClass = function(el) { // Store reference of element in object. this.element = $(el); }; // Store reference of object in element. $('#something').data('obj', new MyClass('#something'));
Tags (comma-separated)
Save Edits
Cancel