I'm getting a trouble while running JS code in a browser. I've got a small web page which uses HTML5 location API for tracking a user. User opens my website, logs in, and goes to a certain page on which I'm using location API to track user's location. Everything works fine until user's phone goes to sleep or user presses "home" button to minimize browser. The same thing happens on both Android and iPhone. I'm getting a trouble while running JS code in