cancelDelayedReloads
Cancels pending automatic ad reloads — the timer-based reloads scheduled for placements that have a reload timer configured. Any pending reload that has not fired yet is cancelled.
Example
Section titled “Example”// Cancel all pending automatic reloadswindow.htag.api('1').cancelDelayedReloads();
// Cancel pending automatic reloads only for specific placementswindow.htag.api('1').cancelDelayedReloads({ elementIds: ['div1', 'div2'] });Parameters
Section titled “Parameters”- options (optional): An object with the following property:
- elementIds (array, optional): An array of element IDs to cancel pending reloads for. If not provided, pending reloads for all placements are cancelled. An empty array cancels nothing.
Return Value
Section titled “Return Value”Returns the Htag API object, allowing for method chaining.
One-shot Cancellation
Section titled “One-shot Cancellation”Cancellation only affects reloads that are pending at call time. It does not disable reloading for the placement: any subsequent render — a refreshAds call, a page transition, or a lazy-loaded placement coming into view — schedules its automatic reload again as usual.
Related Concepts
Section titled “Related Concepts”- refreshAds: Manually refresh ads and re-schedule reloads
- Effects: Learn about managing side effects