1
I have a problem that I receive a string information in return of an ajax but I need to delete the specific line, more for this I need to create a counter of the element of the append I’m not able to do that you could help me
follows the html code:
<table class="table table-bordered">
<thead>
<tr>
<th style="background-color: #606060; color: white; text-align: center;"><b>Image</b></th>
<th style="background-color: #606060; color: white; text-align: center;"><b>Image Name</b></th>
<th style="background-color: #606060; color: white; text-align: center;"><b>Remover</b></th>
</tr>
</thead>
<tbody id="imagelist" style="text-align: center;">
</tbody>
</table>
and the javascript code:
<script>
var options = {
shutter_ogg_url: "jpeg_camera/shutter.ogg",
shutter_mp3_url: "jpeg_camera/shutter.mp3",
swf_url: "jpeg_camera/jpeg_camera.swf",
};
var camera = new JpegCamera("#camera", options);
$('#take_snapshots').click(function(){
var snapshot = camera.capture();
snapshot.show();
snapshot.upload({api_url: "action.php"}).done(function(response) {
var id = id++;
$('#imagelist').prepend("<tr><td><img src='"+response+"' width='100px' height='100px'></td><td><input id='foto' style='border: transparent; background-color: transparent; text-align: center; width: 100%;' type='text' value='"+response+"_""' /></td><td><button style='width: 50%; font-size:30px;' class='btn btn-danger' onclick='apagar();'><i class='glyphicon glyphicon-trash'></i></button></td></tr>");
}).fail(function(response) {
alert("Upload failed with status " + response);
});
})
function done(){
$('#snapshots').html("uploaded");
}
</script>
Thanks brother worked out your logic
– teste1234
Blz! Remember that one should mark in the answer that solved the problem.
– Sam