Reputation: 7160
Inside my index.html
, I have this button that goes to about.html
when tapped.
<div class="col-50">
<a href="about.html">
<div class="button">About</div>
</a>
</div>
And on about page, I would like to detect whenback
button is tapped and that I am now on my index.html
page.
Here's what I've tried:
First attempt:
myApp.onPageInit('index', function (page) {
myApp.alert("test");
});
Second attempt:
myApp.onPageInit('index', function (page) {
myApp.alert("test");
}).trigger();
Upvotes: 0
Views: 531
Reputation: 360
Did you try:
myApp.onPageBack("about", function() {
myApp.alert("test");
});
Do not forget the data-page="about"
attribute in your about
page.
<div class="pages">
<div class="page" data-page="about">
<div class="page-content">
... page content goes here ...
</div>
</div>
</div>
Upvotes: 2