Interval Looper

非同步数组枚举回调

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://update.greatest.deepsurf.us/scripts/3588/10916/Interval%20Looper.js

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

Aŭtoro
Jixun.Moe
Versio
0.0.1.20140725060155
Kreita
2014/07/24
Ĝisdatigita
2014/07/25
Size
2,2 kb
Licenco
N/A

数组循环

// 用法:
var loop = new IntervalLoop ([1, 2, 3], function (next, item) {
	$.ajax ({
		url: 'http://example.com/?id=' + item
	}).success (function (r) {
		// TODO: 处理抓取的数据
		// ...
		
		next ();
	});
}, 500).add (1, 2, 3).add (999).loop ();
 
// 监听事件更新
var xyz = document.addEventListener ('xyz', function (eve) {
	// TODO: 解析数据并传递需要的值
	loop.add(eve.target);
}, false);