javascript not working in the new part when loading a new part using jquery and HTML 5

前端 未结 4 1635
春和景丽
春和景丽 2021-01-25 07:48

Hi as my title suggest, i use the following code to dynamically load a portion of the page (here left id)

function callBackFunctionLoadNextBackInPage(data)
{
            


        
4条回答
  •  离开以前
    2021-01-25 08:10

    I think that the problem is the order in which your events are firing. When you load the page normally, the discuss js is most likely run when load fires. So when you load with ajax, it won't fire the load event. Instead, you will have to initialize these compontent in you callBackFunctionLoadNextBackInPage method or use another callback.

    $.post(url,parm,function(data) {
        callBackFunctionLoadNextBackInPage(data);
    
        // Initialize here
        $('.element').plugin_initializer();
    
    },'html');
    

提交回复
热议问题