1$(document).ready(function () { 2 // get country code of this device and store for 28 days to mitigate ipdata api requests 3 4 if (!isCrawler() && readCookie("country_code") == null) { 5 $.get("https://api.ipdata.co?api-key=237b81873ca8371bcd0ac49280a64bf5bcb6afe0cf495abd2dc6d08f", function (response) { 6 //console.log(JSON.stringify(response, null, 4)); 7 if (response.hasOwnProperty('country_code') && response.country_code != null) { 8 createCookie("country_code", response.country_code, 28); 9 getCountrySpecifics(true); 10 setFlightBasis(); 11 } 12 }, "jsonp"); 13 } 14 else { 15 //console.log("getting country from cookie", readCookie("country_code")); 16 getCountrySpecifics(false); 17 setFlightBasis(); 18 } 19}); 20 21 22function getCountrySpecifics(pIPDataRequest) { 23 //console.log("getting country specifics for: " + readCookie("country_code")); 24 25 $.ajax({ 26 url: "/page/geo.ashx?countryCode=" + readCookie("country_code") + "&ipdr=" + pIPDataRequest, 27 type: "GET", 28 contentType: "application/json; charset=utf-8", 29 dataType: "json", 30 data: "", 31 success: function (data, textStatus, jqXHR) { 32 if (data.message == "success") { 33 $("a.telephoneCountry, a.telephoneCountryDisplay").attr("href", "tel:" + data.number); 34 $(".telephoneCountryDisplay").html(data.display); 35 $(".telephoneCountryCaption").html(data.caption); 36 $(".telephoneCountryCaption").toggleClass("show", data.show); 37 $("a.telephoneCountryAlternative").html(data.alternative); 38 } 39 }, 40 error: function (jqXHR, textStatus, errorThrown) { 41 console.log("ajax:error" + jqXHR.responseText); 42 } 43 }); 44} 45 46function setFlightBasis() { 47 //hide excluding flights basis for uk product if IP location is GB 48 //console.log("setting flight basis for IP location: " + readCookie("country_code") + ", Product location:" + $('#product_country_code').val()); 49 if ($('#product_country_code').length) { 50 if ($('#product_country_code').val() == readCookie("country_code")) { 51 var basis = $('.pricing .basis').html(); 52 if (basis.length > 0 && basis.indexOf('ex') >= 0 && basis.indexOf('flights') >= 0) { 53 $('.pricing .basis').hide(); 54 } 55 }; 56 } 57} 58
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.