Page 1 of 1

How to get current Page name?

Posted: Fri Aug 30, 2013 1:52 pm
by Toblerone

I want to give my users the ability to add bookmarks of pages in my app. So for example if they're on a page called "boomerangs" I want to store that in an array somewhere for bookmarks and then they can come back to it later. I've got the array part sorted, but what I can't get is what page they are currently on? Is there an Appery API to get current page name so that i can simply do a navigateTo() at a later date with the value i've stored?

Thank you


How to get current Page name?

Posted: Fri Aug 30, 2013 2:05 pm
by maxkatz

Something like this:

code
var pagePathName= window.location.pathname;
return pagePathName.substring(pagePathName.lastIndexOf("/") + 1);
/code