[eluser]xwero[/eluser]
I do this by adding the id to the row
Code:
// html
<tr><td>filename</td><td>other info</td><td><span class="hidden">23</span><input type="submit" class="delete" value="delete"></tr>
// javascript
$('.delete').click(function(){
$.ajax({
type: "POST",
url: "index.php/ajax/deletefile",
data: "id="+$(this).prev().text(),
success: function(table){
$('#files').html(table);
}
});
return false
});
To be save you can use an absolute url.
You can even put the code to generate the table in a separate function so you can use it for adding a file and deleting one.