Hello,

Here's what I've made. I have a lot of divs on different pages which
you can Digg (it's called hit). When I click on hit, I've made a code
that send Ajax data to a second page which record everything needed in
the database. That's working easily. But then, I need to add something
to that and I can't. I need to update the number of diggs and add 1
when task is complete and I need also to add it just in one div. I
also have a little message showing up but that's not necessary for
now.

Here's my JS script

$('.hit').each(function(){
                                $(this).click(function(){
                                        var id=this.id;

                                        $.post('../../posts/hit.php', {id:id}, 
function (responseText){
                                                if (responseText == 1){

                                                $
('#responseSuccess').slideDown(1000).fadeOut(4000);

                                                }
                                        })
                                return false;
                                })
                        })

And here's my code where the html is

<a   class="hit" id="<?php echo $id_article ;?>">Hit</a>
         <span style="color:<?php echo $link_color;?>">
                 <?php echo ' (<span class="hit_output"><span>' .
$donnees['hit'] . '</span>         </span>)';?></span>

I probably put too much span and stuff but I tried several things. THe
fact is it never updates just the number of diggs (hits) on the actual
div but on all of them. Or when I had a message id="responseText" it
always shows at the same place even if he updates the good id.

Well, I hope I'm clear. I'm not really good at JS so I just try to
work things out.

Thanks in advance,

Ced

Reply via email to