$$(document).on('page:init','.page[data-name="page1"]',function(e,page){
page.$el.on("click",'.commentbutton',function(){
console.log("i'm at page1");
});
});
$$(document).on('page:init','.page[data-name="page2"]',function(e,page){
page.$el.on("click",'.commentbutton',function(){
console.log("i'm at page2");
});
});
When i navigate to page2
, on clicking commentbutton
, the function of previous page gets called even when current page has already a function defined for it and when i go back to page1 . function at page2 gets called