JavaScript helper for getting current location in browser and dealing with the response.