Skip to main content

A utility function, for Greasemonkey scripts, that detects and handles AJAXed content.

✓ Published0🌍 Public
Aanemochore
Last edited Nov 16, 2012
Created on Oct 17, 2020

The animation shows the recursive polling logic of the `waitForKeyElements` utility, which scans for AJAX-injected DOM nodes matching a jQuery selector. It displays the function’s timer-driven loop, where `setInterval` repeatedly checks for target nodes every 300 milliseconds, invoking the callback action on newly discovered elements. The visualization highlights how the function tracks already-processed nodes using jQuery’s `.data()` method and manages its control object to clear or reset timers based on the `bWaitOnce` flag. The code relies on jQuery selectors and traversal methods, with optional iframe support via `.contents().find()`.

AI-generated description