Append not working correctly

I’m using append for adding dynamic html to .page-content of current page.for example,

$$(document).on('page:init','.page[data-name="feed"]',function(e,page){
   var html=Module.Initialiser(parameters);
   $$('.page-content').append(html);
}

It actually appends html to .page-previous , .page-current.I only want to append html to currently active page. Do i need to give every .page-content a unique id and then append using that id?

It does exactly what you specified, you need to have more correct selector or correct element:

$$(page.el).find('.page-content').append(html);
1 Like

Thanks for the answer but if i provide unique id to every page content, will it be slower or faster than your method?