In my jQuery Mobile multi-page application, is it possible to check if history.back() would be a page within the application?
I have a link on a subpage of the application that I would like to execute history.back() if that refers to a subpage within the application or just plainly link to the application main page otherwise.
I want to do something like
if(canGoBack) {$.mobile.back();} else {$.mobile.changePage('#main');}