2017-10-28 103 views
-1

我有一個jQuery的小問題。 這是我的代碼:我想使元素再次點擊

$("#amis_commun_liste .afficher_plus_modal").bind('click',function f(){ 
    var afficher_plus_modal = $(this).attr("class"); 
    var id = "<?php echo $_GET['id']; ?>"; 


    $.ajax({ 
     type: "post", 
     dataType: "html", 
     url: "voir_profil_includes/func_infos.php", 
     data: { 
     "afficher_plus_modal": afficher_plus_modal, 
     "id" : id   
     }, 
     beforeSend: function() { 
     $("#amis_commun_liste .afficher_plus_modal").html("En cours"); 
     }, 
     success: function(html) { 

     $("#add").html(html); 


     } 
    }); 
    }); 

我想讓元素$( 「#amis_commun_liste .afficher_plus_modal」)點擊再次

謝謝。

+0

你是什麼意思「這不是可點擊」? –

+0

它不可點擊。我想再次點擊它。 – kam

+0

什麼操作會使它變得無法點擊? – zer00ne

回答

0

綁定已被棄用嘗試使用「ON」的方法

$("#amis_commun_liste .afficher_plus_modal").on('click',function f(){ 
var afficher_plus_modal = $(this).attr("class"); 
var id = "<?php echo $_GET['id']; ?>"; 


$.ajax({ 
    type: "post", 
    dataType: "html", 
    url: "voir_profil_includes/func_infos.php", 
    data: { 
    "afficher_plus_modal": afficher_plus_modal, 
    "id" : id   
    }, 
    beforeSend: function() { 
    $("#amis_commun_liste .afficher_plus_modal").html("En cours"); 
    }, 
    success: function(html) { 

    $("#add").html(html); 


    } 
}); 
}); 
相關問題