Toblerone
Posts: 0
Joined: Wed Aug 07, 2013 5:08 pm

How to get current Page name?

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

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

How to get current Page name?

Something like this:

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

Return to “Issues”