在 jhoom.xyz 从事一个项目,并且一直停留在我想限制每个 ip 投票的地方。
` function votereview(reviewid, votetype) {
常量数据 = {
行动:'ipf_vote_review',
评论 id:评论 id,
投票类型:投票类型,
postid: id; ?>
};
jQuery.post('<?php echo admin_url('admin-ajax.php'); ?>', data, function(response) { if (response.success) { const reviewElement = jQuery('.single-review').eq(reviewId); if (voteType === 'up') { let upCount = parseInt(reviewElement.find('.thumb:first').text().match(/\d+/)[0]) + 1; reviewElement.find('.thumb:first').html('👍 (' + upCount + ')'); } else { let downCount = parseInt(reviewElement.find('.thumb:last').text().match(/\d+/)[0]) + 1; reviewElement.find('.thumb:last').html('👎 (' + downCount + ')'); } } else { alert(response.data); } }); }
`
以上就是投票系统Javascript的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号