Difference between revisions of "MediaWiki:Common.js"
MediaWiki interface page
Views
Actions
Namespaces
Variants
Tools
Line 6: | Line 6: | ||
var data = e.json(); | var data = e.json(); | ||
data.forEach(function(dimension) { | data.forEach(function(dimension) { | ||
routeCount += dimension.routes.length | routeCount += dimension.routes.length; | ||
}); | }); | ||
rtElement.innerHTML = routeCount; | rtElement.innerHTML = routeCount; |
Revision as of 03:05, 10 April 2022
$(function () { var rtElement = document.getElementById('rt-stats'); if(rtElement) { var routeCount = 0; fetch("http://78.46.73.156:25674/data").then(function (e) { var data = e.json(); data.forEach(function(dimension) { routeCount += dimension.routes.length; }); rtElement.innerHTML = routeCount; } } }());