Problème de répétition d'exécution du page PHP Depuis Jquery

Fermé
dhaou123 Messages postés 2 Date d'inscription vendredi 22 mai 2015 Statut Membre Dernière intervention 22 mai 2015 - 22 mai 2015 à 12:12
dhaou123 Messages postés 2 Date d'inscription vendredi 22 mai 2015 Statut Membre Dernière intervention 22 mai 2015 - 22 mai 2015 à 12:18
$(document).ready(function() {
$('#amis_connectes a').live('click', function () {
a1 = $(this).attr('data-idm');
b1 = $(this).attr('data-idd');
c1 = $(this).text();/* le nom d'utilisateur */

$("#boite_discuss").slideDown('slow');
$('#ami_disc').html("<img src='images/m_act2.gif' width='10px' height='10px'>" + " " +"<font color='white'>"+c1+"</font>"
+"<img src='images/but_fermer.png' class='fermer' width='23px' height='23px'style='position: absolute; right: 0px'>");
$("#disc_body").html("<center><img align='center' src='images/loaders/loader2.gif' style='margin-top: 50px' ></center>");

if($("#boite_discuss").is(':visible')){
$('#entete #ami_disc .fermer').click(function(){
$("#boite_discuss").fadeOut('fast');
return false;
})
}
/* pour afficher les messages dans la bulle de disc */
function aff_disc(integer,integer){
$.ajax({
type: "POST",
url: "script_php/aff_disc.php",
dataType: 'html',
data: {'a1': a1, 'b1': b1},
success: function (reponse) {
$("#disc_body").html(reponse);
},
error: function (){
$("#disc_body").html("erreur");
}
})
}



$('.t_a_rep').focus(function(){

$(this).keyup(function () {
d1 = $.trim($('.t_a_rep').val());
})

$(this).keypress(function (e) {
if ((e.keyCode == 13) && (!e.shiftKey)){
if(d1 != ""){
$.ajax({/*pour envoyer un message*/
type: "POST",
url: "script_php/env_msg.php",
dataType: 'html',
data: {'a1': a1, 'b1': b1, 'd1': d1},
success: function (e) {
$('.t_a_rep').val("");


},
error: function (e) {
$('.t_a_rep').val(reponse);
}
})
}
}
})
})
setInterval(aff_disc,1000);
return false;
});

})
A voir également:

1 réponse

dhaou123 Messages postés 2 Date d'inscription vendredi 22 mai 2015 Statut Membre Dernière intervention 22 mai 2015
22 mai 2015 à 12:18
La répétition d'appel se fait sur la page "env_msg.php"
J'attend vos solutions et mercii
0