企业网站的一般要素包括,seo优化教程自学网,wordpress给文章添加子页面,宣传片拍摄通知1.页面有9个div#xff0c;类名都是.flag#xff0c;然后想给每个div都绑定一个click事件#xff0c;点击.flag时#xff0c;获取其后代元素.count的值和.ds-subtitle的rel属性。下面这样的写法请问哪里出错了#xff1f;请看开始三行后面注释$(document).ready(function(…1.页面有9个div类名都是.flag然后想给每个div都绑定一个click事件点击.flag时获取其后代元素.count的值和.ds-subtitle的rel属性。下面这样的写法请问哪里出错了请看开始三行后面注释$(document).ready(function(){////$(document).on(click, .flag ,function(){//这一行有问题吗//获取页面点赞次数var count $(this).find(.count).text();//这一行呢//获取news id数据传递到phpvar id $(this).find(.ds-subtitle).attr(rel);//这一行呢alert(id);// alert(count);$.ajax({url:functions/php/like.php,type:POST,// cache:false,data:{count:count,id:id},success:function(data){// alert(data);var str data.split(,);var bool str[0];var nums str[1];// alert(nums);// console.log(data);if (bool 0) {alert(尚未登录);$(#popup-box1).show();}if (bool 1){// alert(你已登录);// $(#popup-box1).hide();$(span .count).text(nums);}}});});});部分html:echo . $nums .;?Like this news post