I have a link a
, which if clicked, leads to a scrpt ajax delete ID .
With código
down I can not get the id
on page from php
// JavaScript Document
$(document).ready(function(e) {
$("a.bloqDesbloq").click(function() {
$.ajax({
url: "../_requeridos/bloqueiaAdministrador.php",
type: 'POST',
data : {
'idadministrador' : $(this).attr('idadmin'),
'bloq' : $(this).attr('bloq')
},
beforeSend: function() {
},
success: function (retorno) {
if (retorno == "OK") {
alert('Bloqueado com sucesso');
location.reload();
} else {
alert("Erro na bloqueio");
}
},
cache: false,
contentType: false,
processData: false
});
return false;
});
});
$ _post
arrives in the php empty array.
Where am I going wrong?
Note: If I do
alert( $(this).attr('idadmin'))
Before calling ajax
, the values appear