Cascading Enumerables

May 10, 2013 at 10:13 AM
Hi Guys

Please could someone help me with the following. I have a table that i want to itterate through and display all the text inside certain span tags.

The below example is a basic example of what i want to do. Also this works fine in IE, Chrome and Firefox, But Safari returns Undefined.

I have been able to find that the "enumerable.from(c.cells).foreach" is where the problem is.

<table id="tableone"> <tr id="rowTest"> <td id="test"> <span id="thisname"><span id="1fName">TR 1 TD 1</span></span> </td> <td><span id="thisperson">TR 1 TD 2</span></td> </tr> <tr id=""> <td id="test"> <span id="thisname"><span id="2fName">R 2 TD 1</span></span> </td> <td><span id="thisperson">TR 2 TD 2</span></td> </tr> </table> <script> $.Enumerable.From($('#tableone tr')).Where('$.id != ""').ForEach(function(e){ $.Enumerable.From(e.cells).ForEach(function(a){ <!--$(a) is where my problem is.--> alert($(a).find('span[id*=fName]').html()); }); }); </script> </body>
May 10, 2013 at 11:25 AM
Found this issue.
put e.cells into $() and all working.