what is expandoProperty. I came across this property while reading about javascript memory leaks. It was told that this property is supported only in Internet Explorer and is responsible for circular reference. But I tried to check and found this property not available in any of the browsers. Any help on this property? and how is it linked to memory leaks!!
+2
A:
I think you mean the expando Property... with a space, referring to the expando
property of objects. It:
sets or retrieves a value indicating whether arbitrary variables can be created within an object.
Peter Ajtai
2010-08-20 08:31:32
A:
Simply put expando property is a property which does not exist originally. In Internet Explorer if you create such a property for a DOM element you may end up with a memory leak. Here is an example:
var div = document.getElementsByTagName('div')[0];
div.someProperty = true; // 'someProperty' is an expando property which may introduce a memory leak in IE
More info can be found in the Understanding and Solving Internet Explorer Leak Patterns
korchev
2010-08-20 08:35:54