Hi,
Um ganz sicher zu gehen, da es vielleicht mal einen Browser gibt, der statt null ein false zurückgibt, solltest Du die Variable auf ihre Belegung prüfen, also in etwa so:
if (text && text != '') { ...
Da sowohl null als auch false als auch ein Leerstring bei der Konvertierung in einen Booleschen Wert false ergeben, sollte ein simples if(text) ausreichen.
MfG ChrisB
--
„This is the author's opinion, not necessarily that of Starbucks.“
„This is the author's opinion, not necessarily that of Starbucks.“