Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

back-button not working after home-button in phonegap app #5397

@markusweb

Description

@markusweb

i am using jquerymobile 1.2 with phonegap 2.2.0 on IOS.
i have an app that starts with the index.html in www-folder of the phonegap app. via ajax i will load other pages/listviews in dom.

index.html -> list1 -> list2 -> detail. on each page the back-buttons works

now i do

index.html -> list1 -> list2 -> [home-button] index.html -> list1

at this stage the back-button does not work anymore. it will try to load the "local" index-file from webserver. i see log entries in error.log at this stage someting went wrong.

i fixed it with:

var homeUrl;
function onDeviceReady() {
homeUrl = $.mobile.urlHistory.stack[0].url;
}
// fix nach klick auf home, klappt der back auf home nicht mehr zuverlässig
$( document ).on( "pagebeforechange" , function(event, data) {
if (data.toPage == homeUrl) {
data.toPage = 'file://' + data.toPage;
}
});

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions