Boas-vindas ao Power Pixel

Junte-se a comunidade! Crie o seu próprio conteúdo, e faça amizades.EntrarCriar uma conta

Delete message by Ajax

5 participantes

waghcwb waghcwb  • Qua 29 Out 2014 - 15:11

Delete message by Ajax Empty Delete message by Ajax Qua 29 Out 2014 - 15:11

Only for testing purposes.

JScript JScript  • Qua 29 Out 2014 - 15:26

Delete message by Ajax Empty Re: Delete message by Ajax Qua 29 Out 2014 - 15:26

Reputação da mensagem: 100% (1 votos)
Eu tenho essa aqui, veja:
Código:

/***
* Fast delete post!
* Function: postDelete(post_ID)
*/
function postDelete(post_ID) {
    var choice = confirm("Tem certeza de que deseja remover esta mensagem?");
    if (choice){
        $.post('/post', {
            p: post_ID,
            mode: "delete",
            confirm: "Sim"
        }).always(function() {
            $('#post_' + post_ID).remove();
            $('html,body').animate({
                scrollTop: $('.post:last').offset().top
            }, 1200);
        });
    }
};
Eu utilizava lá no fórum...


JS

waghcwb waghcwb  • Qua 29 Out 2014 - 15:54

Delete message by Ajax Empty Re: Delete message by Ajax Qua 29 Out 2014 - 15:54

Opa amigo, quando postou a sua ja havia terminado a minha kkk. Implementei a sua com a minha. O que acha?

Código:
   var oDelete = $('a[href*="mode=delete"]');
      oDelete.click(function(event) {

         event.preventDefault();

         var oLink = $(this).attr('href');
         var choice = confirm("Tem certeza de que deseja remover esta mensagem?");
         
         if(choice) {
            $.post(oLink, {
               confirm: 1
            }).success(function() {
               var ID = oLink.match(/p\=(\d+)/g)[0].split('=')[1];
               $('.post--' + ID).remove();
               $('html, body').animate({
                  scrollTop: $('.post:last').offset().top - 55
               }, 700);
            });
         };

      });

Heppy0 Heppy0  • Seg 8 Dez 2014 - 14:29

Delete message by Ajax Empty Re: Delete message by Ajax Seg 8 Dez 2014 - 14:29

Deixe-me testar..........................
#boardtest

xOrlof xOrlof  • Qua 4 Mar 2015 - 21:02

Diapt Diapt  • Seg 13 Jul 2015 - 18:26

Delete message by Ajax Empty Re: Delete message by Ajax Seg 13 Jul 2015 - 18:26

Bom projeto pra isto tópico.
Será útil.

Conteúdo patrocinado  • 

Delete message by Ajax Empty Re: Delete message by Ajax

Permissões neste sub-fórum
Não podes responder a tópicos