Reload javascript file after an AJAX request

前端 未结 10 735
粉色の甜心
粉色の甜心 2020-12-13 20:25

After the request, the new elements created are not recognized by the event handlers in my jQuery code.

Is there a way to reload the file to re-register these events

10条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-13 21:15

    simple way to solve this problem

    $(document).ready(function(){
    
    $('body').on('click','.someClass',function(){
    
    //do your javascript here..
    
    });
    }); 
    

提交回复
热议问题