<head> <script type="text/javascript" src="scripts/jquery.js"></script> <script type="text/javascript"> $(document).ready(function(){ $('a.like').click(function () { $.post("like.cfm", {postid:$(this).attr("postid"),uid:$(this).attr("uid")} ); $(this).hide(); $(".unlike").show(); $(".hw").html($(".hw") + 1); }); $('a.unlike').click(function () { $.post("unlike.cfm", {pageID:$(this).attr("postid")} ); $(this).hide(); $(".like").show(); $(".hw").html('-1'); $(".hw").html($(".hw") - 1); }); }); </script> </head> <body> <a href="##" class="like" postid="1234" uid="131">Like</a> <a href="##" class="unlike" style="display:none;" postid="1234">Unlike</a> <span class="hw">100</span> </body>
$('a.like').click(function () { $.post("like.cfm", {postid:$(this).attr("postid"),uid:$(this).attr("uid")} ); $(this).hide(); $(".unlike").show(); var test=$('span.hw').html(); test++; $(".hw").html(test); });
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)