SOLVED? Re: [Javascript] Fw: hide other divs

Troy III Ajnej trojani2000 at hotmail.com
Thu Apr 13 18:25:11 CDT 2006


>  if(divElementsId != null)
Yes, null or ""  should be equal, but to make sure what's the best practice
is to alert a div with an undefined ID in different browsers and see what
they return, than decide what to use.
But right now checking for an empy (""),
seems more universal to me. Since IDs are passed as strings an
Id="" /*undefined id*/ == "" /*should return*/ TRUE
so: if(divElementsId != "") should be considered as a solid solution.
Besides, I'm not sure if null will always equal "" since I don't know if
all the browsers pass elements ID as string literal or as string object.
But one can easy test it, if alert box comes up empty it's a s literal,
oncontrary, if it returns null, its a s object. After this you are secure to
decide what to use.
And yes, no need to define: divElementsId=""

>there also seems to be a prob with the cache of FF (again!)

That happens with other browsers to, you should recheck your browser 
settings
Again to make sure it reads from source not the chache while debuging. :)


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Troy III
progressive art enterprise
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/




More information about the Javascript mailing list