Jump to content

rwerner

Members
  • Posts

    1
  • Joined

  • Last visited

Posts posted by rwerner

  1. Hello,

    I am building a landing page on Wordpress and would like to use geolocation to change the headline based on user's IP address. I have tried this solution with Snoopi's API:

    <h1><span id="location">{CityName}</span></h1>
    
    <script>
        $('document').ready(function() {
            $.ajax({
              url: "https://api.snoopi.io/check?apikey=XXX", // XXX = API Key
              dataType: "jsonp",
              jsonpCallback: "unBounce" 
            });
        }); // Ready
    function unBounce(json){
       $('#location').html(json.City + ", " + json.State);
    }
    </script>

    **I am not using unBounce to build though and am not sure what to change that value to....? Any advice would be very helpful! 

    Thank you!!

    Riley

×
×
  • Create New...