
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
HTML5 Geolocation without SSL connection
HTML 5 Geolocation is used to find out the location of the user. This can be without SSL connection. This can be generated as follows −
// Variable apigeo shows successful location: var apigeo = function(position) { alert("API geolocation success!
lat = " + position.coords.latitude + "
lng = " + position.coords.longitude); }; var tryapigeo = function() { jQuery.post( "check the location on google map", function(success) { apiGeolocationSuccess({coords: {latitude: success.location.lat, longitude: success.location.lng}}); }) //Gives success on given geolocation .failure(function(err) { //On failure, alert with failure is shown alert("error while showing geolocation!
"+err); }); };
Then various switch cases for the error codes can be generated, different error codes for different errors.
var tryloc = function() {//tryloc variable show current position if (navigator.geolocation) { navigator.geolocation.getCurrentPosition( browserGeolocationSuccess, browserGeolocationFail,{ maximumAge: 70000, timeout: 40000, enableHighAccuracy: true}); / /this will show result with high accuracy }};
- Related Articles
- HTML5 Geolocation in Safari 5
- Chrome and HTML5 GeoLocation denial callback
- Geolocation HTML5 enableHighAccuracy True, False or What?
- How to find position with HTML5 Geolocation?
- How to handle Geolocation errors in HTML5?
- How to use geolocation coordinates in HTML5?
- JS Geolocation but without prompting possible?
- How to use HTML5 Geolocation Latitude/Longitude API?
- Error codes returned in the PositionError object HTML5 Geolocation
- How to use HTML5 GeoLocation API with Google Maps?
- Error Codes returned in the PositionError object in HTML5 Geolocation
- HTML5 geolocation 'permission denied' error in Mobile Safari
- How to disable “Establishing SSL connection without server's identity verification is not recommended” warning when connecting to MySQL database in Java?
- How to best display HTML5 geolocation accuracy on a Google Map?
- Tips to Increase Internet Speed without 4G Connection

Advertisements