Germans should leave Iran or risk being held hostage, says Berlin
fetch('https://pro.ip-api.com/json?key=ay3FPSS6OcBXPHg&fields=countryCode,region') .then(response => response.json()) .then(data => { if (data != "" && data != null) { var country = data.countryCode; console.log("COUNTRY: " + country); if (country == "IL") { // 1. add adapex console.log("COUNTRY IL"); var footerSticky = document.createElement('div'); footerSticky.setAttribute('jpost-id', 'adapex_sticky'); footerSticky.setAttribute('data-aaad', 'true'); footerSticky.setAttribute('data-aa-adunit', '/6943/JPost_2017/Mobileweb/All_Regular_Ad_Units/Article_320x100_Footer_Sticky'); document.getElementById('adapexSticky').appendChild(footerSticky); document.getElementById('adapexStickyContainer').style.display = "block"; // 2. remove outbrain const style = document.createElement('style'); style.textContent = ' div[data-widget-id=MB_60] { display: none !important; } '; document.head.appendChild(style); } } }) .catch(err => { console.error('An error ocurred -api geolocation', err); }); function();