It's ok. It 's nice when it works.

Thank you Chris your precious help.


//gestion autres voyages : on affiche le formulaire et les voyage
   $("#envies_voyages").click( function(){
        $("#vip_affichage").html("");
        $("#vip_affichage_voyages").css("display","none");
        $("#vip_affichage_envies").css("display","block");
$.ajax({url:'mes_envies.php?action=affichage', complete: function(data) {
                   //$("#vip_affichage").html(data.responseText);
$("#vip_affichage").prepend(data.responseText); //to generate html $("a").bind("click", function(event){ // to add event to html generated
                           event.preventDefault();
                             var id         =     $(this).attr("title");
                           var params         = "id_envie="+id;
$.ajax({url:'mes_envies.php?action=del?'+params, complete: function(data) { $("#vip_affichage").html(data.responseText);
                                   return false;
                                  }
}); return false;
                   });
return false;
           }
}); return false; });



Jamal Arbib a écrit :

Thank you for your help Chris !

I try this but it doesn't work.

this is  the html generated

<div id="mesenvies">
    <ul>
        <li>
            <span class="lib_voyage">Argentine</span>
<a href="javascript:void(0)" title="1envie" class="del_voyage">Supprimer</a>
        </li>
        <li>
            <span class="lib_voyage">Autriche</span>
<a href="javascript:void(0)" title="2envie" class="del_voyage">Supprimer</a>
        </li>
        <li>
            <span class="lib_voyage">Bahamas</span>
<a href="javascript:void(0)" title="3envie" class="del_voyage">Supprimer</a>
        </li>
    </ul>
</div>


and this is  jquery code

$("a").bind("click", function(event){
            event.preventDefault();
              alert("ok");
              var id         =     $(this).attr("title");
            alert (id);
    });


Chris Domigan a écrit :

Jamal, you need to rebind events to elements after updating them via ajax.

------------------------------------------------------------------------

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


--
Jamal Arbib
Responsable technique - monagence.com
[EMAIL PROTECTED]
01 46 21 80 27

------------------------------------------------------------------------

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


--
Jamal Arbib
Responsable technique - monagence.com
[EMAIL PROTECTED]
01 46 21 80 27

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to