I have this list of items, and I have a button at the bottom for deleting some of them according to their checkboxes. I also got a response from a jQuery get() with the elements that represent the new list. So, the rest need to be removed. This is how my list is built :
<table style="float:left;width:100%">
<tbody>
<?php foreach ($items as $item): ?>
<tr>
<div>
<td ?>;
<input type="checkbox" name="item_<?php echo $item['NAME'];?>" value="<?php echo $item['ID'];?>" />
</td>
</div>
</tr>
<?php endforeach; ?>
</tbody>
I use the get() function and get the following reply in json.
[{"ID":"2","EMAIL":"[email protected]","DATETIME":"2011-12-12 03:20:01"},{"ID":"4","EMAIL":"[email protected]","DATETIME":"2011-10-09 01:15:22"}"]
All I want to do now is simply eliminate the correspoding where the input value (which is the json's ID) is NOT in the json reply.
Any ideas how to do this with jQuery ? Thanks !