Send Geo-location from Browser

Create a button and log the current LAT/LON when the button is pressed:

<button id="send-location"> Send location</button>
document.querySelector('#send-location').addEventListener('click', () => {

    if (!navigator.geolocation) {

        return alert ('Geolocation not supported by Browser !')

    }
    
    navigator.geolocation.getCurrentPosition((position) => {

        console.log(position)

    })

console.log output

How JavaScript works: Deep dive into WebSockets and HTTP/2 with SSE + how to pick the right path

This is post # 5 of the series dedicated to exploring JavaScript and its building components. In the process of identifying and describing…

Source: How JavaScript works: Deep dive into WebSockets and HTTP/2 with SSE + how to pick the right path