Skip to content
David Kittell
David Kittell

Application & System: Development / Integration / Orchestration

  • Services
    • Application Development
    • Online Application Integration
  • Code
  • Online Tools
  • Tech Support
David Kittell

Application & System: Development / Integration / Orchestration

HTML5 Geolocation

Posted on November 5, 2013October 26, 2015 By David Kittell

[raw]

Click the button to get your coordinates:



[/raw]

<!DOCTYPE html>
<html>
<body>
<p id="demo">Click the button to get your coordinates:</p>
<button onclick="getLocation()">Try It</button>
<script>
var x=document.getElementById("demo");
function getLocation()
  {
  if (navigator.geolocation)
    {
    navigator.geolocation.getCurrentPosition(showPosition);
    }
  else{x.innerHTML="Geolocation is not supported by this browser.";}
  }
function showPosition(position)
  {
  x.innerHTML="Latitude: " + position.coords.latitude +
  "<br>Longitude: " + position.coords.longitude + "<br>Map: <a href=http://maps.google.com/?q=" + position.coords.latitude + "," + position.coords.longitude + " target=_blank>http://maps.google.com/?q=" + position.coords.latitude + "," + position.coords.longitude + "</a>";
  }
</script>
</body>
</html>

Source: http://www.w3schools.com/html/html5_geolocation.asp

Originally Posted on November 5, 2013
Last Updated on October 26, 2015
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.

Related

Code HTML5

Post navigation

Previous post
Next post

Related Posts

Install SQL PowerShell Tools

Posted on October 14, 2015October 14, 2015

To install the 2014 PowerShell tools, the script below will help make it a bit easier. First all downloads are referenced from this URL (specific for SQL 2014) http://www.microsoft.com/en-ca/download/details.aspx?id=42295 I use Windows 64-Bit so if you use 32-Bit make sure you update your links # Microsoft® Windows PowerShell Extensions for…

Read More

PowerShell Set DNS Settings

Posted on September 24, 2015October 16, 2015

This only works on Windows 8, 8.1, 10 as the Cmdlets Set-DnsClientServerAddress Get-DnsClientServerAddress are introduced in Windows 8. First get the interface name(s) you want to modify Get-DnsClientServerAddress Change the code below to the interface you wish to change $primarydns = $args[0] $secondarydns = $args[1] Set-DNSClientServerAddress –interfaceAlias Wi-Fi –ServerAddresses ($primarydns,$secondarydns)…

Read More

Remote Desktop Port Change

Posted on July 18, 2013October 26, 2015

‘Kelly Theriot 11-2004 ‘Kelly’s Korner Option Explicit Set ws = WScript.CreateObject("WScript.Shell") Dim ws, t, p1, n, cn, MyBox, vbdefaultbutton Dim itemtype p1 = "HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlTerminal ServerWinStationsRDP-Tcp" n = ws.RegRead(p1 & "PortNumber") t = "Change Port Number" cn = InputBox("Type in the new port number", t, n) If cn <> "" Then…

Read More

Code

Top Posts & Pages

  • PowerShell - Rename Pictures to Image Taken
  • Front Page
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions

Recent Posts

  • Javascript – Digital Clock with Style
  • BASH – Web Ping Log
  • BASH – Picture / Video File Name Manipulation
  • Mac OSX Terminal – Create SSH Key
  • Bash – Rename Picture

Top Posts

  • PowerShell - Rename Pictures to Image Taken
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions
  • Open On Screen Keyboard (OSK)
  • SQLite - Auto-Increment / Auto Generate GUID
©2025 David Kittell | WordPress Theme by SuperbThemes