19'];var foundwords = [];Badwords.foreach(函数(value){var正则表达式= new regexp(值,'gi'); var res2 = bodytext.match(正则表达式); if(res2 && res2.length> 0)foundwords.push(value);});if(foundwords && foundwords.length> 0){console.log('找到了坏字:'+ foundwords.join());googlefleag.pubads()。Settargeting(“关键字”,fownwords.join());}如果(window.querystring.notarget ===未定义|| window.querystring.notarget ===''){var specfunc = function(){var specs = [];if(window.visitor.usercontentspecialty)specs.push(window.visitor.usercontentspecialte.replace(/ [^ a-za-z&\ / \ \ s] / g,''));if(window.localstorage){var specstorage = localstorage.getItem(“contentspecialties”);specstorage = specstorage?specstorage.split(','):[]; if (contentSpecialty && contentSpecialty !== '' && specstorage.indexOf(contentSpecialty) === -1) specstorage.splice(0,0,contentSpecialty.replace(/[^a-zA-Z&\/\s]/g, '')); if(specstorage.length > 3) specstorage.splice(2, 1); localStorage.setItem("contentspecialties", specstorage.toString()); specs = specs.concat(specstorage); } return specs.join(); }; var specstring = specfunc(); if(specstring) googletag.pubads().setTargeting("specialty", specstring); if (contentSpecialty !== '') { googletag.pubads().setTargeting("contentspecialty", contentSpecialty); } // use collection name instead of subspec when available if (("").length > 0) { googletag.pubads().setTargeting("collection", ""); } else { if (contentSubspecialty !== '') { googletag.pubads().setTargeting("contentsubspecialty", contentSubspecialty); } } googletag.pubads().setTargeting("traffictype", window.Visitor.type); if (contentType !== '') googletag.pubads().setTargeting("contenttype", contentType); if ("{304F3192-D384-4729-AF00-0CD0F734F044}" !== '') googletag.pubads().setTargeting("documentid", "{304F3192-D384-4729-AF00-0CD0F734F044}"); if (window.trafficmedium !== undefined) googletag.pubads().setTargeting("trafficmedium", window.trafficmedium); if (window.trafficsource !== undefined) googletag.pubads().setTargeting("trafficsource", decodeURI(window.trafficsource)); } window.viewedAds = []; googletag.pubads().addEventListener('impressionViewable', function (event) { var slotname = event.slot.getAdUnitPath(); setTimeout(function () { window.viewedAds.push(slotname.replace("/136749668/Healio5_", "")); }, 2000); //if (window.ga) // ga('send', 'event', 'Viewability', 'Viewed', slotname, 0, { // 'nonInteraction': true // }); var eventparams = { 'event_category':'Viewability', 'event_action': 'Viewed', 'event_label': slotname, 'non_interaction': true, 'value': 0 }; // see if gtag is available, if not give it a second and try once more. if (typeof (gtag) !== "undefined") { gtag('event', eventparams.event_action, eventparams); } else { window.setTimeout(function () { if (typeof (gtag) !== "undefined") gtag('event', eventparams.event_action, eventparams); }, 1000); } }); window.googletag.cmd.push(function () { window.googletag.pubads().collapseEmptyDivs(true); window.googletag.enableServices(); }); firstLoad(isMobile, adLoadDelay); tryRenderPopup(adLoadDelay); // Drew 2020-06-04: we used to only do this for mobile googletag.pubads().addEventListener('slotRenderEnded', function (event) { // Drew 2020-06-17: we have a different event handler specifically for the popup ad var slotElementId = event.slot.getSlotId().getDomId(); var slotElement = document.getElementById(slotElementId); /*if (window.ga) { var slotname = event.slot.getAdUnitPath(); ga('send', 'event', 'Viewability', 'Slot Loaded', slotname, 0, { 'nonInteraction': true }); }*/ if (slotElement.classList.contains('popup-ad')) return false; // ---- if (!event.isEmpty) { if (console.log && window.queryString.verbose === '1') console.log(event.slot.getSlotId() + ' Ad placed, checking for content.'); if ($("#" + event.slot.getSlotId().getDomId()).html().length > 0) { if (console.log && window.queryString.verbose === '1') console.log(event.slot.getSlotId() + ' We seem to have content.'); // once we have a rendered ad slot it's safe to remove all other stickiness document.getElementsByClassName("sticky-ad").forEach(function (e) { if (e.id !== slotElementId) e.classList.remove("sticky-ad"); }); if (isMobile) { $("#" + event.slot.getSlotId().getDomId()).parent().addClass("article-listing-card"); $(".card--layout").masonry('reloadItems').masonry('layout'); $("#" + event.slot.getSlotId().getDomId()).parent().css('opacity', '1'); } } else { if (console.log && window.queryString.verbose === '1') console.log(event.slot.getSlotId() + ' We do not seem to have content.'); if (console.log && window.queryString.verbose === '1') console.log(event.slot.getSlotId() + ' Ad empty, setting layout.'); $("#" + event.slot.getSlotId().getDomId()).closest('.card-placeholder, .ad-unit').remove(); } } else { if (console.log && window.queryString.verbose === '1') console.log(event.slot.getSlotId() + ' DFP error - Ad empty, setting layout.'); $("#" + event.slot.getSlotId().getDomId()).closest('.card-placeholder, .ad-unit').remove(); } return true; }); var lastDistanceFromTop = $(window).scrollTop(); var scrollTimeout; var throttle = 150; $(window).on('scroll', function () { if (!scrollTimeout) { scrollTimeout = setTimeout(function () { if (isMobile && window.isTestSection) { var distanceFromTop = $(window).scrollTop(); var offset = distanceFromTop - lastDistanceFromTop; //console.log("offset " + Math.round(offset)); lastDistanceFromTop = distanceFromTop; if (offset < 35 && offset > -35) // faster than x and we don't want to load the ads. lazyload(); } else { lazyload(); } scrollTimeout = null; }, throttle); } }); return true; } $j(document).ready(function() { if (window.location.pathname.toLowerCase().indexOf("/news/hematology-oncology") > -1 && document.querySelector('meta[name="bi:content_type"], meta[name="page_type"]').content === "Landing") { $j("body.news").addClass("hematology-oncology"); } if (window.Visitor === undefined && window.sessionStorage) window.Visitor = JSON.parse(sessionStorage.getItem("visitor", "")); if (window.Visitor !== undefined && window.Visitor !== "" && window.Visitor !== null && !window.Visitor.isbot && window.Visitor.type !== "DC") adinit(); else { window.addEventListener("globalsloaded", function () { //dont run if we're a bot if (window.Visitor !== undefined && window.Visitor !== "") { if (window.sessionStorage) sessionStorage.setItem("visitor", JSON.stringify(window.Visitor), "sessionStorage"); if (window.Visitor !== undefined && window.Visitor !== "" && window.Visitor !== null && !window.Visitor.isbot && window.Visitor.type !== "DC") adinit(); } }); } }); window.queryString = (window.queryString || {}); window.location.search.substring(1).split('&').forEach(function (param) { var kvp = param.split('='); if (kvp.length === 2 && kvp[0].length > 0 && kvp[1].length > 0 && !window.queryString.hasOwnProperty(kvp[0])) Object.defineProperty(window.queryString, kvp[0], { value: kvp[1] }); }); if (window.queryString.forcemobile === '1') window.orientation = window.orientation || {};