jQuery-loadedNode

检测节点是否完全加载

Versione datata 10/04/2020. Vedi la nuova versione l'ultima versione.

Questo script non dovrebbe essere installato direttamente. È una libreria per altri script da includere con la chiave // @require https://update.greatest.deepsurf.us/scripts/399868/790609/jQuery-loadedNode.js

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name         jQuery-loadedNode
// @namespace    http://tampermonkey.net/
// @version      0.3
// @description  检测节点是否完全加载
// @author       YiJie
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
	try{
		if(typeof jQuery=="undefined") return;
	}catch{return;}
	jQuery.fn.loadedNode = function (selector, func, times, interval) {
		var _times = times || -1,
		_interval = interval || 100,
		_self = $(_selector),
		_selector = selector,
		_iIntervalID;
		if( _self.length ){
			func && func.call(_self);
		} else {
			_iIntervalID = setInterval(function() {
				if(!_times) {
					clearInterval(_iIntervalID);
				}
				_times <= 0 || _times--;
				_self = $(_selector);
				if( _self.length ) {
					func && func.call(_self);
					clearInterval(_iIntervalID);
				}
			}, _interval);
		}
		return this;
	}
})();