Results 1 to 4 of 4
  1. #1
    Join Date
    May 2005
    Location
    Voorhees, NJ
    Posts
    10

    Javascript Incompatibilities

    The following line works fine in Firefox, but seems to kill IE6 in its tracks.

    document.getElementById(id).style.display="table-cell";

    This is a line in a for loop. Firefox iterates through all 42 times, but IE6 only does the first iteration.

    Has anybody encountered this before?

  2. #2
    Join Date
    Oct 2002
    Location
    Canada
    Posts
    3,100

    Re: Javascript Incompatibilities

    Originally posted by jwnichols
    The following line works fine in Firefox, but seems to kill IE6 in its tracks.

    document.getElementById(id).style.display="table-cell";

    This is a line in a for loop. Firefox iterates through all 42 times, but IE6 only does the first iteration.

    Has anybody encountered this before?

    Could it be that you have multimple elements with the same id? If so you should give them different ids (id_1 , and id_2) and then loop throught that.

  3. #3
    Join Date
    May 2005
    Location
    Voorhees, NJ
    Posts
    10
    Nice thought, but all elements have a unique ID. Here's the entire loop
    The value of results.length is validated before the loop starts. You can see the two lines of code I commented out to make IE6 work.

    Code:
       for (var i=4; i<=results.length; i++)
       {
         var str = results[i-1];
         var day =  i-3;
         var id="cell" + day.toString();
         if (str == "0")
         {
           document.getElementById(id).innerHTML="&nbsp;";
      //     document.getElementById(id).style.display="table-cell";
         }
         else
         {
           document.getElementById(id).innerHTML=str;
      //     document.getElementById(id).style.display="table-cell";
         }
       }  //for

  4. #4
    Join Date
    Jul 2001
    Location
    Canada
    Posts
    1,284
    If I recall correctly the display style valid values are auto, inherit, none, block, and inline.
    "Obsolesence is just a lack of imagination."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •