Jquery function doesn't work after Ajax call

后端 未结 7 1280
滥情空心
滥情空心 2020-12-09 12:46

I\'ve got this function:

$(document).ready(function() {
$(\'.post_button, .btn_favorite\').click(function() {


//Fade in the Popup
$(\'.login_modal_message\         


        
7条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-09 13:32

    You need to bind the jQuery click event once your ajax content is replaced old content

    in AJAX success block you need to add code like here new response html content one a tag like

    Click Me
    

    So you can bind the new click event after change the content with following code

    $("#new-tag").click(function(){
       alert("hi");
       return false;
    });
    

提交回复
热议问题