gpt4 book ai didi

javascript - jQuery : missing ; before statement

转载 作者:行者123 更新时间:2023-12-02 11:11:34 25 4
gpt4 key购买 nike

我根本不知道为什么会收到此错误(我读了每个具有类似名称的主题,但这些问题的答案均​​不适用):

$(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'); });

});

最佳答案

postAndFade($node, post_key) {

您缺少 function关键字。
var id = $node.parents.('.id').find('.id-value').text();

.之后,您还有一个额外的 parents

关于javascript - jQuery : missing ; before statement,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7663813/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com