I am developping an app to calculate the drift of a boat from its initial route. In the header I have a cancel (cross) button that should do 2 things when tapped:
I can do 1. with clearwatch, no problem:
document.getElementById("close").addEventListener("click", function( event ) {
navigator.geolocation.clearWatch(geo);
});
But I don't know how to do 2. Any hint?
(I have noticed that very few apps proposed this "close" option and they stay open unless you force them to close through the Application Manager. Could this have an impact (pure speculation from me) on memory and performance?)
You can use window.close()
to close windows.
(This also works for other referenced window objects, e.g., pop-ups or window.opener
.)