我有數據的一個表:檢查和在陣列中的jquery替換值
<table id="disparities" class="datatable">
<thead>
<tr>
<th scope="col">Events</th> <th scope="col">White</th> <th scope="col">Black</th> <th scope="col">Hispanic</th><th scope="col">Asian/Pacific Islands</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Hospitalizations</th>
<td>0.00</td>
<td>20</td>
<td>10</td>
<td>5</td>
</tr>
<tr>
<th scope="row">ED Visits</th>
<td>19</td>
<td>90</td>
<td>40</td>
<td>18</td>
</tr>
</tbody>
</table>
我有檢索從上述表中的值到像這樣(0.00,19)
陣列的功能var points1 = $('#disparities td:nth-child(2)').map(function() {
return $(this).text().match(/\S+/)[0];
}).get();
我要檢查,如果有一個0.00的值(或者它可能只是0),並更改該值NA ... 所以我的結果數組然後(NA,19) 真的不知道如何去做這件事,無論是在最初的比賽還是作爲一個單獨的行動...
感謝這個偉大的工作。我喜歡它保持它的功能,我明白了:-) – liz 2010-06-10 19:52:08