irabbit Posted November 7, 2016 Share Posted November 7, 2016 Hello, friends. Can anyone explain me how i can add phone number to header and that automatically changes based on visitor geolocation. Im used this code in contentBox module: <script>// <![CDATA[ window.onload = $.getJSON("http://ip-api.com/json/?callback=?", function(data) { if(data.regionName == 'Moscow'){ jQuery(".region-phone").text('+7 (333) 333-33-33'); jQuery(".region-phone-href").attr('href', 'tel:+73333333333'); } else if(data.regionName == 'St.-Petersburg'){ jQuery(".region-phone").text('+7 (222) 222-22-22'); jQuery(".region-phone-href").attr('href', 'tel:+72222222222'); } else if(data.regionName == 'Chelyabinsk'){ jQuery(".region-phone").text('+7 (111) 111-11-11'); jQuery(".region-phone-href").attr('href', 'tel:+71111111111'); } else { jQuery(".region-phone").text('+7 (000) 00-00-00'); jQuery(".region-phone-href").attr('href', 'tel:+70000000000'); } }); // ]]></script> <div class="region-phone"></div> But it didn't work after i turned on ssl. Link to comment Share on other sites More sharing options...
irabbit Posted November 8, 2016 Author Share Posted November 8, 2016 Time to bump my topic Someone, please, help. Link to comment Share on other sites More sharing options...
El Patron Posted November 9, 2016 Share Posted November 9, 2016 check chrome console messages when https, you say issue with https but there is no debug information Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now