1
데이터를 사용하려고 :이 코드가()
$('.solicitud_amistad').click(function(){
var aux = $(this);
console.log($(this));
console.log($(this).data('receptor'));
$.post('amistad/nueva' , {id_receptor:$(this).data('receptor')},
function(response){
aux.replaceWith(response)
}
);
});
을 나는이 출력을 받고 있어요 :
<a class="solicitud_amistad" data-receptor="4">Enviar solicitud de amistad</a>
undefined
내가 대신
undefined
의
4
을 기대했다.
당신의보기가 저를 위해 작동합니다. http://jsfiddle.net/M7JjF/ –
.data ('수용체')를 사용하고 있지만 요소의 키는 데이터 수용체입니까? – osoner
도 나에게 효과적이다. http://jsfiddle.net/qKuZq/ - jquery의 어떤 버전을 사용하고 있습니까? – swatkins