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

Michael Borchers list at tridemail.de
Thu Apr 13 01:41:47 CDT 2006


> Laurent, your script should have worked perfectly if you haven't 
> accidentally misstyped
> "=" (asingement) instead of "!=" (comparement) in your substituted 
> conditional.
> 
> ---------------------------------------------------------------------
>       var divElementsId = ''
> if(divElementsId != divElements[i].getAttribute("id")){//that is, -not 
> empty! Than...
> if(divElementsId.substring(0,6) == mySubstring && divElementsId != 
> myDiv)//All other, but not myDiv. Than...
>   {
>    divElements[i].style.display = "none";//Hide them!
>    }     }}

i don't know why, but suddenly my script would work by using this

    for(i=0;i<divElements.length;i++)
 {
  var divElementsId = divElements[i].getAttribute("id");

  if(divElementsId != null)
  {
...


there also seems to be a prob with the cache of FF (again!)
not reloading my javascript. FF is trapping me with this eversince
and i hate it's caching.

it's just important to != null instead of != '', then there is need of
defining the var divElementsId = ''.

strange! you wake up in the morning and suddenly everything seems to work;)



More information about the Javascript mailing list