summaryrefslogtreecommitdiffstats
path: root/modules-available/statistics/templates/js-pciquery.html
blob: 556831616a46accc1a77d369cd61c1f0c64e9578 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<script>
	document.addEventListener('DOMContentLoaded', function() {
		var missing = {{{missing_ids}}};
		var doQuery = function() {
			if (missing && missing.length > 0) {
				$.ajax({
					url: '?do=statistics', dataType: "json", method: "GET", data: {
						action: 'json-lookup',
						list: missing.splice(0, 10) // Query 10 at a time max
					}
				}).done(function (data) {
					if (!data)
						return;
					for (var k in data) {
						$('.query-' + k.replace(':', '-')).text(data[k]);
					}
					doQuery();
				});
			}
		}
		doQuery();
	});
</script>