Explanation: on browser back the JS is not executed. How can I make it execute?
If you mean that you have JS (<script>) tags in Ajax loaded pages, you may parse them using these technic https://github.com/nolimits4web/Framework7/issues/70. Otherwise you need to use page callbacks
No, I have js methods defined and call them on pageInit. When I click on a link everything is fine. The problem is when I go deeper and want to go back (as in browser back button), it goes back but the javascript does not execute on pageInit (nor does it execute on pageAfterAnimation).
This is also the problem I'm facing, the back buttom seems do not load the last viewed page, that's why it's not triggered on clicking back, however you can run the function you want if you target the the back button. ex. $$('.back').click(function() { // run }; ); The only problem is when they swipe it back, I don't know if there's a callback function to it after it it's swiped back.
I'm not using the "soft" back, I'm using the browser's back...
@olanchuy when you go back to previous preloaded page there is not 'pageInit' event for it. Use pageBeforeAnimation and pageAfterAnimation callbacks
@Jure the same, use pageBeforeAnimation and pageAfterAnimation events If you need to do something each time the page is shown
thanks, this wasn't working for me before, I guess I had a bug. Now it works perfectly.
Hey jure could you share with us a sample code. I'm really curious about how you did it? I'm also trying to use browsers back but I couldn't trigger it correctly..
I have functions for each page I load. So, for mypage.jsp where I don't want tabbar, I do this: $$(document).on('pageInit', function (e) { var page = e.detail.page; if (page.name==='mypage') { mypage(); } ... ... ... }); $$(document).on('pageBeforeAnimation', function (e) { var page = e.detail.page; if (page.name==='mypage') { tabOff(); } else tabOn(); });