javascript handle device back button code example
Example: document.addEventListener("backbutton
document.addEventListener("backbutton", yourCallbackFunction, false);
document.addEventListener("backbutton", yourCallbackFunction, false);