I have the following situation, I make an append and inside it I need to send a delete method, to treat it in the web service I'm having doubts, I've already tried to create a form inside, but it does not work, detail if I put the link " link '+ v.iduser +' / delete" inside the href it works however in webservice I deal with delete method ie it requests that is this method, and if I change in the webservice to get it works, but it is not safe at all, jquery code:
<script>
$(document).ready(function(){
$.getJSON('http://localhost/projetohtml/admin/users-list-all',function(data){
$.each(data, function(k, v){
$('#table-users').append("<tr>"+'<td>'+v.iduser+'</td>'+
'<td>'+v.desperson+'</td>'+
'<td>'+v.desemail+'</td>'+
'<td>'+v.deslogin+'</td>'+
'<td>'+v.inadmin+'</td>'+
'<td><a href="/projetohtml/admin/users/'+v.iduser+'"class="btn btn-primary btn-xs"><i class="fa fa-edit"></i> Editar</a></td>"'+
'<form action="http://localhost/projetohtml/admin/users/'+v.iduser+'/delete" id="form-delete" method="delete">'+
'<td><a href="#" id="iduser-delete" class="btn btn-danger btn-xs"><i class="fa fa-trash"></i> Excluir</a></td>'+'</form>'+"</tr>");
});
});
});
</script>