Lernprogramm aus W3schools

HTML APIs

Geolocation

The HTML Geolocation API is used to get the geographical position of a user. Since this can compromise privacy, the position is not available unless the user approves it.
Note: As of Chrome 50, the Geolocation API will only work on secure contexts such as HTTPS. If your site is hosted on an non-secure origin (such as HTTP) the requests to get the users location will no longer function.

window.width = 0

window.height = 0

HTML Geolocation

Click the button to get your coordinates.