Hi, i post this to ask that why my code isnt working well, at least it worked.
- Code:
<!-- BEGIN switch_vote_active -->
<div id="pacount{comment.displayed.U_POST_ID}" class="pavotecmnt">
<span class="gensmall">
<script type="text/javascript"> var str ='{comment.displayed.switch_vote_active.L_VOTE_TITLE}'; if (str=="Message not voted") {str="Not liked.";document.write(str); } else {str=str.replace("Message reputation :",""); str=str.replace("100%",""); str=str.replace("(",""); str=str.replace(")","");str=str.replace("vote","likes."); str=str.replace("s",""); document.write(str); }</script>
</span></div>
<!-- BEGIN switch_vote -->
<span class="pavotecmnt"id="{comment.displayed.U_POST_ID}">
<a href="{comment.displayed.switch_vote_active.switch_vote.U_VOTE_PLUS}" target="v{comment.displayed.U_POST_ID}v" onclick="document.getElementById('{comment.displayed.U_POST_ID}').innerHTML='';var str ='{comment.displayed.switch_vote_active.L_VOTE_TITLE}'; if (str=='Message not voted') {str='Not liked.'; }else {str=str.replace('Message reputation :',''); str=str.replace('100%',''); str=str.replace('(',''); str=str.replace(')','');str=str.replace('vote','likes.'); str=str.replace('s',''); } if(str=='Not liked.') {str='1 like.'; }else{ for (i=0; i<=(str.length-1);i++) {if (str.charCodeAt(i)>=48 && str.charCodeAt(i)<=57 && str.charAt(i+1)==' ') {str=str.replace(String.fromCharCode(str.charCodeAt(i)),String.fromCharCode((str.charCodeAt(i))+1));}}}document.getElementById('pacount{comment.displayed.U_POST_ID}').innerHTML='<span class=gensmall>'+ str+'</span>'; ">Like</a>
</span>
<!-- END switch_vote --><!-- END switch_vote_active -->
Last edited by Draud0229 on Sat Feb 06 2016, 15:08; edited 1 time in total