• Register
  • Log In
  • Home
  • Quick Start
    • Configurator
    • Download YUI 3
  • Documentation
    • User Guides
    • Examples
    • Tutorials
    • API Docs
  • Community
    • Gallery
    • Blog »
    • Forums
    • YUI Theater
    • Calendar
  • Contribute
    • YUI on GitHub »
    • File a Ticket
    • View Tickets
    • Dashboard
  • Other Projects
    • YUI 2
    • YUI Compressor
    • YUI Doc »
    • YUI Builder
    • YUI PHP Loader
    • YUI Test
    • YUI Website
  • YUI
  • >
  • Community
  • >
  • Gallery

Gallery

Modules

  • Home
  • Featured
  • Popular
  • New
  • All

Documentation

  • FAQ
  • Developer FAQ
  • Developer Guide
  • Module Setup

Tag Cloud

plugin form animation model satyam caridy table liferay datatable event jafl io yql apipkin css nzakas solmsted widget ericf davglass greghinch node foxxtrot lsmith async

Context Navigation

    YUI Library is not responsible for bugs or support with this module. It is available as a free service. For support please contact the module owner with the provided links.

    Geo (gallery-geo) on cdn

    Last Updated: 07/14/11
    + 0 -

    Nicholas C. Zakas

    YUI Developer

    See 7 more by this user.

    Featured Item

    Created: 04/26/11
    Last CDN Push: 10/20/11
    Build Tag: gallery-2011.10.20-23-28
    Project: YUI 3
    License: YUI BSD
    YUI Version: 3.4.0 PR2
    Free for use.

    Even though the native geolocation API is in almost every new browser, there are a lot of older browsers without this capability. This module uses the native API where available and falls back to an IP lookup when not possible. If the native API call fails, the IP lookup is done as a fallback. This module honors the user's request not to share information, so if the native API call fails because the user denied permission, it will not attempt the IP-based lookup.

    • Tags:
    • nzakas
    • Download
    • Docs
    • Homepage
    • Bugs
    • Source
    • Example
    • Forum
    • History

    Code Sample

    <script src="http://yui.yahooapis.com/3.4.0 PR2/build/yui/yui-min.js"></script>
    YUI({
        //Last Gallery Build of this module
        gallery: 'gallery-2011.10.20-23-28'
    }).use('gallery-geo', function(Y) {
     
        Y.Geo.getCurrentPosition(function(response){
     
            //check to see if it was successful
            if (response.success){
                console.log(response.coords.latitude);
                console.log(response.coords.longitude);
            }
     
        });
     
    });

    Forum Posts

    Subject Author Date
    pidgets.geoip queries the wrong ip address Steven Olmsted 05/12/11
    Error in the example code &amp; a fix ashusta 06/27/11

    © 2006-2011 Yahoo! Inc. All rights reserved.
    All code on this site is licensed under the BSD License unless stated otherwise.
    About This Site · Security Contact Info