Move geoloc from html page to js file