Giter Club home page Giter Club logo
</title>
<script> // Fetch data from a JSON API fetch('https://api.example.com/data') .then(response => response.json()) .then(data => { // Display the data on the HTML page document.getElementById('data-container').innerHTML = JSON.stringify(data, null, 2);

Location Access Example

Get Location

<script> function getLocation() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(showPosition, showError); } else document.getElementById("demo").innerHTML = "Geolocation is not supported by this browser."; } } <script> function showPosition(position) { var latitude = position.coords.latitude; var longitude =position. coords.longitude;document. getElementById("demo").innerHTML = "Latitude: " + latitude + "
Longitude: " + longitude; } function showError(error) { switch(error.code) { case error.PERMISSION_DENIED: document.getElementById("demo").innerHTML = "User denied the request for Geolocation."; break; case error.POSITION_UNAVAILABLE: document.getElementById("demo").innerHTML = "Location information is unavailable."; break; case error.TIMEOUT: document.getElementById("demo").innerHTML = "The request to get user location timed out."; break; case error.UNKNOWN_ERROR: document.getElementById("demo").innerHTML = "An unknown error occurred."; break; } } </script>

Who am i?'s Projects

ddplot icon ddplot

Making ggplot2 graphics in DD Story Hub style✨

docs icon docs

The open-source repo for docs.github.com

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.