sample html:
<tr>
<td class="hidden tblLnk">8163</td>
</tr>
<tr>
<td class="hidden tblLnk">8163</td>
</tr>
<tr>
<td class="hidden tblLnk">8164</td>
</tr>
this method should return a unique array of text from rows with a specific td class. { 8163, 8164 } in our sample.
works in ffs and chrome but not in ie8 or safari. can you spot the problem?
function getUniqueIds()
{
var tblLnks = new Array();
$('td.tblLnk').each(function()
{
tblLnks.push($(this).text().trim());
});
return tblLnks.unique();
}
I think this:
should be this:
If your intention is to us jQuery’s trim() function.