Hi,
I am doing you-tube like/dislike script for my web page having comments given by user and other users may like or dislike the comments.
I want to do is that when user click on like or dislike images , it automatically update the database and update the counter on web-page with out refresh.
this is the code I am using for auto update database and auto refresh .. here update to the database is coming but auto refresh is not happening.
could any one help me in this issue.
I am doing you-tube like/dislike script for my web page having comments given by user and other users may like or dislike the comments.
I want to do is that when user click on like or dislike images , it automatically update the database and update the counter on web-page with out refresh.
Code:
<script type="text/javascript">
$(document).ready(function()
{
$(".like").click(function()
{
var id=$(this).attr("id");
var name=$(this).attr("name");
var dataString = 'id='+ id + '&name='+ name;
$("#votebox").slideDown("slow");
$.ajax
({
type: "POST",
url: "rating.php",
data: dataString,
cache: false,
success: function(html)
{
$(#refreshelement).load();
}
});
});
});
</script>
<div id="refreshelement">
<?php getting data form database ?>
<div><a class="like">like</a><?php get count like?></div>
<div><a class="like">dislike</a><?php get count like?></div>
</div>
could any one help me in this issue.
Comment