Skip to content

CODExperiments

Doing it MY way!

  • Home
  • 2010
  • August
  • 31
  • HTML 5 Geolocation API

HTML 5 Geolocation API

Posted on August 31, 2010January 2, 2015 By Zoon 1 Comment on HTML 5 Geolocation API
HTML5, Javascript, Programming

The new HTML specification, version 5, is great! There is a host of new things to explore including embedded video, SVG, Canvas element (more on that later!) and… Geolocation services! I would like to give you a small demonstration of the API.

Remember to support NZB Completion Checker – Sign up to Astraweb via this banner 🙂

[sourcecode language=”javascript”]
<script type="text/javascript" language="javascript">
if(navigator.geolocation)
{
navigator.geolocation.getCurrentPosition(function(position){
yourposition(position.coords.latitude, position.coords.longitude);
});
}
else
{
alert("geolocation is not supported in your browser!");
}

function yourposition(latitude, longitude)
{
alert(latitude+","+longitude);
}
</script>
[/sourcecode]
If you copy the outputted coordinates into Google maps, it should hopefully show your current location on the map.

[ad name=”Google Adsense-1″]

For more infomation on the Geolocation API and more examples, please go to W3C

Working example
Please click here to try it out! Beware, the geolocation lookup might take a few seconds to complete!

Tags: HTML5 Javascript

Post navigation

❮ Previous Post: Windows 7 and PHP/MySQL
Next Post: Sharepoint 2010 MCTS ❯

You may also like

Programming
Digitalocean – deploy a server in less than 55 seconds!
September 2, 2014
Android
Netflix Global Search – Android App.
July 30, 2014
Programming
Crash course in HLSL
March 25, 2010
Programming
NZB Completion Checker Alpha Update #5
May 11, 2012

One thought on “HTML 5 Geolocation API”

  1. Floor Lamp says:
    January 30, 2011 at 01:23

    ‘:- I am really thankful to this topic because it really gives up to date information .”-

Leave a Reply

You must be logged in to post a comment.

Downloads

Get it while it's HOT:
NZBcc 1.2.2.0

Downloads
might be ad supported. If so, click in top right corner to continue when the counter reaches 0.

Support NZBcc



Sign up to Dropbox using this link

Archives

  • March 2016
  • September 2014
  • July 2014
  • January 2014
  • August 2013
  • January 2013
  • December 2012
  • November 2012
  • September 2012
  • August 2012
  • June 2012
  • May 2012
  • March 2012
  • February 2012
  • January 2012
  • December 2011
  • November 2011
  • October 2011
  • August 2011
  • July 2011
  • April 2011
  • January 2011
  • December 2010
  • November 2010
  • August 2010
  • July 2010
  • April 2010
  • March 2010
  • January 2009

Tag Cloud

AJAX Android Articles C# Download FMV Giganews HLSL HTML HTML5 Javascript jQuery MPEG Decoding MySQL Netflix NZB NZBcc PHP SQL Usenet Windows 7 XNA

Copyright © 2025 CODExperiments.

Theme: Oceanly News Dark by ScriptsTown