Hello everybody !
I just bought Diggie from Solspace to have a +1/-1 voting system on my web site. The module works well and when I click on +1 it sends me to a page that displays “You voted +1” and records the vote in the control panel.
The only thing is, I would like to have the “You voted +1” appear on the page and not ending you to another page. So I figured out that I have to use some Ajax to do so. I need to load the content in the url that sends you to that “You voted +1” and display it below the entry. Btw this is on the index page, with multiple entries. I’ve tried some stuff here and there with Jquery but nothing is working. :(
Could someone explain me step by step how to do that ? Help would be highly appreciated.
Thank you
Trenkwill
PS : Just has an example (and to show how bad I am at jquery) this is 3 javascripts that I’ve tried to adapt to my template :
[removed]
$().ready(function() {
{exp:weblog:entries weblog="definition" orderby="date" sort="desc" limit="10" disable="member_data|trackbacks" rdf="off"}
$('.vote_{entry_id}').click(function() {
$.get(this.href, function(data) {
$('span.vote_message_{entry_id}').html(data);
});
});
{/exp:weblog:entries}
});
[removed][removed]
$(function() {
$('.vote_12').click(function() {
$('<div class="vote_message_1"></div>').load('{path="diggie/vote"}{entry_id}/{diggie:flag_id} .vote_info', function() {
$(this).show()
.appendTo('.vote_12');
});
return false;
})
});
[removed][removed]
$(document).ready(function() {
$('.vote_12').click(function(){
var toLoad = $(this).attr('href')+' ul.vote_info';
$('.content_info').hide('fast',loadContent);
$('.content_info').append('<span>LOADING...</span>');
function loadContent() {
$('.vote_info').load(toLoad,'',showNewContent())
}
function showNewContent() {
$('.vote_info').show('normal',hideLoader());
}
return false;
});
});
[removed]I know that nothing’s good in there but I’m trying !
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.