I found where the combination of $$ and IE7 breaks down in the series
of nested HTML. Again, it works fine in Firefox in all conditions I
have tested, and it works fine in IE7 for static HTML. Consider the
following series of debugging statements:
var debugTBodyTrArray = $$("#" + empTableId + " tbody tr");
var debugTBodyTrTdArray = $$("#" + empTableId + " tbody tr td");
var debugTBodyTrTdDivArray = $$("#" + empTableId + " tbody tr td
div");
var debugTBodyTrTdDivInputArray = $$("#" + empTableId + " tbody
tr
td div input");
alert("debugTBodyTrArray.size before clone and insert: " +
debugTBodyTrArray.size() );
alert("debugTBodyTrTdArray.size before clone and insert: " +
debugTBodyTrTdArray.size() );
alert("debugTBodyTrTdDivArray.size before clone and insert: " +
debugTBodyTrTdDivArray.size() );
alert("debugTBodyTrTdDivInputArray.size before clone and
insert: " +
debugTBodyTrTdDivInputArray.size() );
I then add a <TD> enclosing an <Input> to the DOM as follows:
var clonedRow = rowArray[0].cloneNode(true);
tbody.insertBefore(clonedRow, ptoRow);
Then I revisit the series of debugging statements, as follows:
var debugTBodyTrArray2 = $$("#" + empTableId + " tbody tr");
var debugTBodyTrTdArray2 = $$("#" + empTableId + " tbody tr
td");
var debugTBodyTrTdDivArray2 = $$("#" + empTableId + " tbody tr
td
div");
var debugTBodyTrTdDivInputArray2 = $$("#" + empTableId + "
tbody tr
td div input"); //the problem occurs here !!!
alert("debugTBodyTrArray2.size before clone and insert: " +
debugTBodyTrArray2.size() );
alert("debugTBodyTrTdArray2.size before clone and insert: " +
debugTBodyTrTdArray2.size() );
alert("debugTBodyTrTdDivArray2.size before clone and insert: " +
debugTBodyTrTdDivArray2.size() );
alert("debugTBodyTrTdDivInputArray2.size before clone and
insert: "
+ debugTBodyTrTdDivInputArray2.size() );
The number of tr's, td's, and div's is reported to increase in this
second set of statements, as they should. However, the reported
number of input's is improperly reported to be unchanged. The IE7
Developers Toolbar and the Firefox View Generated Source both show the
same <input> nested within the <div>, which is nested within the <td>,
as follows:
<TD class="middle_cell_style" noWrap height="23">
<DIV align="center">
<INPUT class="emp1Time" id="emp1SatPer3Start" readOnly maxLength="8"
size="7" name="emp1SatPer3End" _counted="undefined" value="" />
</DIV>
</TD>
Bill
-------------------------------------------------------------
On Nov 28, 6:14 pm, Ken Snyder <[EMAIL PROTECTED]> wrote:
> BillT wrote:
> > ...
> > Specifically, there were 28 static html widgets satisfying this $$,
> > plus the dynamically added, 29th widget.
>
> > When I then loop with the following, the loop apparently attempts to
> > include the dynamically added widget. It successfully loops through
> > the 28 pre-existing static html, then basically crashes on the first
> > instruction inside the loop for the dynamically added 29th widget:
>
> > widgetArray.each(function(widget) {
> > alert("Beginning loop"); //crashes here
>
> > Any help would be very much appreciated.
>
> What kind of crash? Do you get an exception message? Are you waiting
> 10ms to allow the DOM tree to refresh?
>
> - Ken Snyder
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---