August 15, 2000 - Expnado Properties
August 15, 2000 Expando Properties Tips: August 2000
Yehuda Shiran, Ph.D.
|
borderColor
property of a style
object and you type instead bordercolor
, a new expando property will be created. As a consequence, the border color will not be changed according to your specifications and you will have difficult time figuring out why.
To protect you from doing such mistakes, you should set the expando property to false
:
document.expando = false;
To reset it back:
document.expando = true;
If you try to create an arbitrary property when document.expando
is false
, you'll get an error message that the object does not support such property. The following two lines yield no error (myDiv
is the ID
of a DIV
element somewhere on the page):
document.expando = true;
myDiv.myProperty = myValue;
while the following two lines yields an error message telling you that the object myDiv
does not support the property myProperty
:
document.expando = false;
myDiv.myProperty = myValue;