Rappeler une function Callback
	
	
		Bonjour à tous, 
Je viens de m'apercevoir un petit problème, je n’arrive pas à rappeler ma fonction une deuxième fois de suite, ce que j’ai plus constaté c’est qu'au bout de quelques minutes il est possible de rappeler cette fonction.  
	Code:
	
<button id="tweeter" class="g-recaptcha btn btn-secondary btn-sm tweet-btn" data-theme="dark" data-sitekey="<?php echo $sitekey; ?>" data-callback="sendtweet"><?php echo $btntweet; ?></button>
 
	Code:
	
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
   | function sendtweet() {
    var text = $('#tweet-textbox').val();
    var retweet = $("#tweet-retweetbox").val();
    var picture = $('#tweet-picturebox')[0].files[0];
    var hashtag = $('#tweet-hashtagbox').val();
 
    formdata = new FormData();
    var gresponse = grecaptcha.getResponse();
    grecaptcha.reset();
 
    formdata.append("tweet", text);
    formdata.append("retweet", retweet);
    formdata.append("picture", picture);
    formdata.append("hashtag", hashtag);
    formdata.append("g-recaptcha-response", gresponse);
 
    if (text.length < 20) {
        $('#tweet-short').fadeIn(400);
        $('#tweet-short').delay(3000).fadeOut(400);
    } else {
        $("#charNum").html('<img src="assets/images/tweet/loader.gif" alt=""/>');
        $("#tweet-textbox").val('');
        $("#tweet-retweetbox").val(0);
        $("#tweet-picturebox").val('');
        $("#tweet-hashtagbox").val('');
 
        $.ajax({
            type: 'POST',
            url: 'includes/post.tweeter.php',
            data: formdata,
            processData: false,
            contentType: false,
            success: function(data) {
                if (data.status === 'ok') {
                    $('#tweet-success').fadeIn(400);
                    $('#tweet-success').delay(3000).fadeOut(400);
 
                    setTimeout(function() {
                        $(location).attr('href', 'index.php');
                    }, 3800);
                } else if (data.status === 'blocked') {
                    $('#tweet-blocked').fadeIn(400);
                    $('#tweet-blocked').delay(3000).fadeOut(400);
                } else if (data.status === 'upload') {
                    $('#tweet-upload').fadeIn(400);
                    $('#tweet-upload').delay(3000).fadeOut(400);
                } else if (data.status === 'captcha') {
                    $('#tweet-captcha').fadeIn(400);
                    $('#tweet-captcha').delay(3000).fadeOut(400);
                } else if (data.status === 'guest') {
                    $("#user_login").modal();
                } else {
                    $('#tweet-error').fadeIn(400);
                    $('#tweet-error').delay(3000).fadeOut(400);
                }
 
                $("#charNum").html('');
                $("#charNum").html('300');
            },
            error: function() {
                $('#tweet-error').fadeIn(400);
                $('#tweet-error').delay(3000).fadeOut(400);
                $("#charNum").html('');
                $("#charNum").html('300');
            }
        });
    }
} | 
 Merci. :D