I have no idea whatsoever why I am getting this error (I read every topic with a similar name but the answers to those questions didn’t apply):
$(document).ready(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'); });
});
You’re missing the
functionkeyword.You have an extra
.afterparents.