ribbon Enter Now

Want a brand new website for your charity worth over £5,000?

Positive Web Design is offering one lucky charity the incredible opportunity to win just that!

Call Free for an instant quote
  • /wp-content/themes/default/images/headings/bespoke-sites.png
  • /wp-content/themes/default/images/headings/brochure-sites.png
  • /wp-content/themes/default/images/headings/ecommerce-sites.png
  • /wp-content/themes/default/images/headings/template-sites.png
GET A FREE QUOTE
  • Posts Tagged ‘web design geolocation’

    Using HTML 5 Geolocation

    Monday, April 30th, 2012

    It has been said that the latest version of the Hypertext Markup Language which is being released by the World Wide Web Consortium as a result of the collaborative efforts of its stakeholders is much more different from the previous versions of the HTML scripting language. This changes or differences may be attributed with the fact that internet technology is changing or improving. One example of the improvement in internet technology is the possibility of using videos and audios as part of a web page, many web browsers were updated and or developed in order to interpret video and audio codes, however, prior to HTML 5 such interpretations require the use of a third party application in order to effectively display the video or audio. With HTML 5 there is no need for the installation of a third party application just to make sure that the video would function accordingly.

    Another latest addition to the internet technology is the use of Geolocation, through geolocation internet users could have the web browsers identify their current location. With HTML 5 you can already include in your website design the current position of the websites’ visitor. Although this may seem as an act of integrating a feature that would compromise the privacy of the user, HTML 5 does not allow automatic Geolocation detection rather it would first ask the user if he or she would like to utilise or activate such feature.

    Steps in Incorporating Geolocation in Web Design

    The presentation below shows the HTML 5 code for including a Geolocation property for your website design:

     Web Design Geolocation Code

    Explaining the Web Design Code

    1. As always there is a need to assign a variable to the document. In this case the variable y is assigned to document.getElementById(“geoloc”)

    2. An if-else statement is used in order to validate the presence of the Geolocation feature of a web browser. If the browser has Geolocation installed the getCurrentPosition method will be executed to gather data on the user’s current location.

    3. If the web browser does not have Geolocation installed then the message “Your browser does not support geolocation” will appear.

    4. Once the getCurrentPosition functions properly the showPosition method will be activated and will display the latitude and longitude coordinates of the user.

    Conclusion on Geolocation

    Geolocation was integrated not for the purpose of compromising a persons’ privacy but rather for a multitude of benefits. For one location search relevance will be increased if the searchers position is known. Further, geolocation is focused on helping improve social media experience. For the website owner, incorporating Geolocation in your web design will help increase the accuracy of your site statistics with regards to your daily site visitors.