가 작동하려면이 코드를 얻기 위해 노력하는 정의되지하지만 난 불을 지르고에서 점점 오전 오류가 $this is not defined
하고JQuery와 -이는
이 코드에 대한 배경을 설명하기 위해 왜 난의 목록을 이해하지 못하는 $ 동일한 클래스가 있으므로 특정 스팬을 클릭하면 해당 스팬을 업데이트하고 아약스 요청을 보내야합니다.
희망적으로는 의미가 있습니다.
$(document).ready(function() {
function postAndFade($node, post_key) {
var id = $node.parents('.id').find('.id-value').text();
var post_val = $node.text();
$node.fadeOut('slow');
$.ajax({
type: "POST",
url: "process.php",
data: "id="+id+"&"+post_key+"="+post_val,
success: function(data) {
$node.html(data);
$node.fadeIn('slow');
}
});
return false;
}
$('.featured-value').click(function() { return postAndFade($this, 'featured'); });
$('.visible-value').click(function() { return postAndFade($this, 'visible'); });
});
의 (이) $를 사용하는,하지만 정말 뭔가 '$이'라고해야합니까? 아마도 '이'또는 '$ (이)'를 의미할까요? –
이것이 오류의 원인이되는 코드 블록입니까? – kand