Jun
5
5
I’ve noticed something weird under Firefox and how it evaluates flow control statements…
Basically what I’ve noticed is that when I did
Javascript
-
if(document.getElementById("someID") == null)
-
{
-
// create new element with someID here
-
}
and I’ve put this in a timer event, so it was called every 60sec.
So what happened? Firefox evaluated it as
Javascript
-
if(document.getElementById("someID"))
Argh, completely the other way around I was expecting it !
Workaround?
Javascript
-
if( (document.getElementById("someID") == null ) )
-
{
-
// create new element with someID here
-
}
God bless FireBug ![]()


Leave a Reply