1(function (window) { 2 'use strict'; 3 (function () { 4 function getScript(source, callback) { 5 var script = document.createElement('script'); 6 var prior = document.getElementsByTagName('script')[0]; 7 script.async = 1; 8 script.onload = script.onreadystatechange = function( _, isAbort ) { 9 if(isAbort || !script.readyState || /loaded|complete/.test(script.readyState) ) { 10 script.onload = script.onreadystatechange = null; 11 script = undefined; 12 if(!isAbort && callback) setTimeout(callback, 0); 13 } 14 }; 15 script.src = source; 16 prior.parentNode.insertBefore(script, prior); 17 } 18 // Instead of remote: https://js.maxmind.com/js/apis/geoip2/v2.1/geoip2.js, point to same file hosted on offers. 19 getScript('https://www.healthmarketadvisor.com/js/geoip2.js', function(){ 20 window.geoip2.city(function(data){ 21 // GeoIP is done. You can do something with the data object, like filling fields etc: 22 if (typeof window.console.log !== 'undefined'){ 23 // console.log('GeoIP data retrieved.', data); 24 // console.log('IP: ' + data.traits.ip_address || '');
25 // console.log('Zip: ' + data.postal.code || ''); 26 // console.log('City: ' + data.city.names.en || ''); 27 // console.log('State: ' + data.subdivisions[0].iso_code || ''); 28 // console.log('State Name: ' + data.subdivisions[0].names.en || ''); 29 window.maResults(data.traits.ip_address, data.postal.code, data.city.names.en, data.subdivisions[0].iso_code, data.subdivisions[0].names.en); 30 } 31 }, function(data){ 32 // Something went wrong. 33 if (typeof window.console.warn !== 'undefined'){ 34 // console.warn('Failed to get GeoIP.', data); 35 } 36 }); 37 }); 38 }()); 39}(typeof window !== 'undefined' ? window : this));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.