무한 루프에서 마우스 윈도우를 아래로 움직여 googletag.pubads(). refresh ([currentAdSlot])를 사용하고 있는데 ' slotRenderEnded '이벤트를 새로 고친 후. 하지만 각각 내가 새로 고침 기능을 호출 할 때 'slotRenderEvent'가 누적 적으로 트리거됩니다. 예를 들어 첫 번째 ResendAd 함수 호출에서 이벤트를 한 번만 듣고 있습니다. 초 단위 호출에서 이벤트를 두 번 듣고 계속이 카운트를 증가시킵니다. 이 버그를 수정하는 방법? 뭐가 잘못 됐는지 이해가 안돼? Google dfp api의 버그 또는 코드입니까?pubads(). refresh ([currentSlot])
function ResendAd(AdSlot,callback) {
googletag.pubads().clearTargeting();
googletag.pubads().updateCorrelator();
googletag.pubads().refresh([AdSlot]);
googletag.pubads().addEventListener('slotRenderEnded', function (event) {
console.warn('This function scope triggered multiple times.');
if (event.slot === AdSlot) {
if (!event.isEmpty) {
if (callback && typeof callback === "function") {
callback(event);
}
}
}
});
}