Just try to Call this document addEventListener inside the pageshow function.
you have to check the backbutton event in the every page show.
This example will help you,
$(document).bind ('pageshow', function (e, data) {
document.addEventListener("backbutton", function () {
setTimeout( function() {console.log("PhoneGap Ready!");}, 100 );
}, true);
}
});
Just call this bind method in the onDeviceReady method. Body onLoad Event does not work in some cases of phonegap. Use with phonegap events.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…