Hello Maryna,
Here is my page scrennshots,
When I tap the row , I want change the number ('likecount') in red cycle in picture.
Tap event runs javascript below:
///////////////////////////////////////////////////////////////////////////////
var likecommentarr =[];
var comment_id = localStorage.getItem("_comment_id");
var likecommentstr = localStorage.getItem("_likecomment_array");
if (likecommentstr !== null && likecommentstr !== "") {
likecommentarr = JSON.parse(likecommentstr);
if (likecommentarr !== null && $.inArray(comment_id, likecommentarr)=0) {
alert("you have already click this comment!");
return;
}
}
updatebbscommentlikecountparse.execute({
success:function(data){
Code: Select all
[b] $(this).find('[name=likecount]').text(data.likeCount);[/b]
alert($(this).find('[name=likecount]').text());// pop up space
if (likecommentstr !==null && likecommentstr !=="") {
likecommentarr = JSON.parse(likecommentstr);
}
if (likecommentarr !== null) {
likecommentarr.push(comment_id);
} else {
likecommentarr = [];
likecommentarr.push(comment_id);
}
if (likecommentarr.length 10) {
likecommentarr.shift();
}
localStorage.setItem("_likecomment_array", JSON.stringify(likecommentarr));
},
error:function ( jqXHR, textStatus, errorThrown ) {
alert("error44");
}
});
///////////////////////////////////////////////////////////////////////////////