PageSourceSearch

https://transmundial.org/lib/jQuery/wait-until-exists/jquery.wait-until-exists.js?1790832932

js transmundial.org collected 2026-10-03 22:08:15 UTC 1,124 bytes, 22 lines download raw bytes

vendor: 1,124 bytes, lines 1-22
1(function ($) {
2    /**
3     * @function
4     * @property {object} jQuery plugin which runs handler function once specified element is inserted into the DOM
5     * @param {function} handler A function to execute at the time when the element is inserted
6     * @param {bool} shouldRunHandlerOnce Optional: if true, handler is unbound after its first invocation
7     * @example $(selector).waitUntilExists(function);
8     */
9    $.fn.waitUntilExists	= function (handler, shouldRunHandlerOnce, isChild) {
10        var found	= 'found';
11        var $this	= $(this.selector);
12        var $elements	= $this.not(function () { return $(this).data(found); }).each(handler).data(found, true);
13
14        if (!isChild) {
15            (window.waitUntilExists_Intervals = window.waitUntilExists_Intervals || {})[this.selector] =
16                window.setInterval(function () { $this.waitUntilExists(handler, shouldRunHandlerOnce, true); }, 500);
17        } else if (shouldRunHandlerOnce && $elements.length) {
18            window.clearInterval(window.waitUntilExists_Intervals[this.selector]);
19        }
20        return $this;
21    }
22}(jQuery));

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.