I have a site that has voting on the front page node, and I need to update a view on the same node after each vote. I'm currently using the following code in my page.tpl.php
<script type="text/javascript">
function fivestarResult(voteResult) {
$('div#fivestar-summary-'+voteResult.vote.id).html(voteResult.result.summary);
window.location = "http://www.mydomain.com/";
};
</script>
Is there a way to directly refresh the view instead of refreshing the whole page? I'm not very good in javascript so I'm a little lost.
An idea i may do in this kind of situation is to Ajax call the view again and render it inside the page again via JQuery on click event.
take this example , i guess this will clarify more
Drupal 6: Render Views 2 data in a page tpl file