How to write up to 98% faster JavaScript code.

JavaScript performance comparison

Revision 13 of this test case created

Info

This test shows that frameworks built on a global namespace (jQuery, YUI, Prototype, ...) could have been up to 98% faster (Firefox) if they were written in a string based modular fashion like it is used by Compact.js that is based on Require.js

Please tell me wrong, I can't believe it :-) Dominik Guzei Wizzart

Preparation code

<script>
  (function() {
   var f = {},
       g = Array.prototype.slice;
   window.define = function() {
    var a = arguments,
        d = a[0],
        b = null;
    a = g.call(a, 1);
    if (a.length > 1) {
     b = a[0];
     for (var c = [], e = 0; e < b.length; e++) c[e] = f[b[e]];
     b = a[1].apply(this, c)
    } else b = a[0]();
    f[d] = b
   };
   window.require = function() {
    var a = arguments,
        d = [],
        b = null;
    a.length > 2 && (a = g.call(a, 1));
    d = a[0];
    b = a[1];
    a = [];
    for (var c = 0; c < d.length; c++) a[c] = f[d[c]];
    b.apply(this, a)
   }
  })();
 
 
  var Library2 = {
   util: {
    add: function(a, b) {
     return a + b;
    }
   },
 
   cool: {
    Class: function(startValue) {
     this.value = startValue;
    }
   }
  };
 
  var Library2utiladd = Library2.util.add;
 
  Library2.cool.Class.prototype.addToValue = function(value) {
   this.value = Library2utiladd(this.value, value);
  };
 
 
  define('Library.util.add', function() {
   return function(a, b) {
    return a + b;
   }
  });
 
  define('Library.cool.Class', ['Library.util.add'], function(add) {
 
   var Class = function(startValue) {
    this.value = startValue;
   };
 
   Class.prototype.addToValue = function(value) {
    this.value = add(this.value, value);
   };
 
   return Class;
 
  });
 
  var Library2coolClass = window.Library2.cool.Class;
</script>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
Global namespace chain
// ==UserScript==
// @name        Netwars Stream List
// @namespace   ds
// @include     http://netwars.pl/*
// @version     0.1
// @grant       none
// @require         http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js
// ==/UserScript==

var div = document.getElementById('stream_list').innerHTML;
document.getElementById('stream_list').innerHTML="";
document.getElementById('stream_list').innerHTML += '<div id="title">StarCraft: Brood War:';
document.getElementById('stream_list').innerHTML += '<div id="BW"></div>';
document.getElementById('stream_list').innerHTML += '</div>';
document.getElementById('stream_list').innerHTML += '<div id="title">StarCraft II: Heart of the Swarm:';
document.getElementById('stream_list').innerHTML += '<div id="SC2"></div>';
document.getElementById('stream_list').innerHTML += '</div>';
document.getElementById('stream_list').innerHTML += '<div id="title">Dota 2:';
document.getElementById('stream_list').innerHTML += '<div id="DOTA2"></div>';
document.getElementById('stream_list').innerHTML += '</div>';
document.getElementById('stream_list').innerHTML += '<div id="title">League of Legends:';
document.getElementById('stream_list').innerHTML += '<div id="LOL"></div>';
document.getElementById('stream_list').innerHTML += '</div>';
document.getElementById('stream_list').innerHTML += '<div id="title">Others:';
document.getElementById('stream_list').innerHTML += '<div id="Others"></div>';
document.getElementById('stream_list').innerHTML += '</div>';

twitch = [
        { "nick": "BeyondTheSummitTV", "channel": "beyondthesummit"},
        { "nick": "BeyondTheSummitTV2", "channel": "beyondthesummit2"},
        { "nick": "Bunny", "channel": "liquidbunny"},
        { "nick": "Center", "channel": "quanticcenter"},
        { "nick": "Dendi", "channel": "dendi"},
        { "nick": "DieStar", "channel": "mdiestar"},
        { "nick": "DOTA2 PL", "channel": "dota2_pl"},
        { "nick": "Draskyl", "channel": "draskyl"},
        { "nick": "DreamHack", "channel": "dreamhacksc2"},
        { "nick": "ESL.TV SC2", "channel": "esltv_sc2"},
        { "nick": "Fragbite Masters", "channel": "fragbitelive"},
        { "nick": "HerO", "channel": "liquidhero"},
        { "nick": "INnoVation", "channel": "acerinnovation"},
        { "nick": "itsHafu", "channel": "itshafu"},
        { "nick": "Jaedong", "channel": "egjd"},
        { "nick": "joinDOTABlue", "channel": "joindotablue"},
        { "nick": "joinDOTARed", "channel": "joindotared"},
        { "nick": "Koget", "channel": "kogetbw"},
        { "nick": "Marwin", "channel": "ifumarwin"},
        { "nick": "MaSsanSC", "channel": "massansc"},
        { "nick": "MMA", "channel": "acermma"},
        { "nick": "Nathanias", "channel": "nathanias"},
        { "nick": "Patience", "channel": "azubupatience"},
        { "nick": "Pike", "channel": "pikepl"},
        { "nick": "Polt", "channel": "polt"},
        { "nick": "Scarlett", "channel": "scarlettm"},
        { "nick": "Selendis", "channel": "selendissc"},
        { "nick": "SingSing", "channel": "sing_sing"},
        { "nick": "Snute", "channel": "liquidsnute"},
        { "nick": "Stephano", "channel": "egstephano"},
        { "nick": "TaeJa", "channel": "liquidtaeja"},
        { "nick": "TLO", "channel": "liquidtlo"},
        { "nick": "Totalbiscuit", "channel": "totalbiscuit"},
        { "nick": "trutaCz", "channel": "trutaacz"},
        { "nick": "WCS Europe 2", "channel": "wcs_europe2"},
        { "nick": "WingsOfDeath", "channel": "wingsofdeath"},
        { "nick": "Zazu", "channel": "zazu__"},
    { "nick": "Arteezy", "channel": "arteezy"},
    { "nick": "BasetradeTV", "channel": "basetradetv"},
    { "nick": "Bjergsen", "channel": "tsm_bjergsen"},
    { "nick": "Cella", "channel": "slayerscella"},
    { "nick": "ChanmanV", "channel": "chanmanv"},
    { "nick": "Chaox", "channel": "chaoxlol"},
    { "nick": "Elazer", "channel": "osomfire"},
    { "nick": "emsc2tv", "channel": "emstarcraft"},
    { "nick": "ESGN TV", "channel": "esgn_tv"},
    { "nick": "ESL.TV PL SC2", "channel": "esltvpl_sc2"},
    { "nick": "Forgg", "channel": "forgg"},
    { "nick": "Funkay", "channel": "funkay_sc "},
    { "nick": "Gieco", "channel": "giecotv"},
    { "nick": "GOM EXP", "channel": "gsl"},
    { "nick": "Indy", "channel": "indystarcraft"},
    { "nick": "Journey", "channel": "journey92"},
    { "nick": "KDL EN", "channel": "kdl_en"},
    { "nick": "Khaldor", "channel": "khaldor"},
    { "nick": "Koget", "channel": "kogetbw"},
    { "nick": "Kripparrian", "channel": "nl_kripp"},
    { "nick": "MaNa", "channel": "liquidmana"},
    { "nick": "Mestru", "channel": "mestru"},
    { "nick": "Michus", "channel": "castplay"},
    { "nick": "Miszu", "channel": "miszu94"},
    { "nick": "Nebu", "channel": "nebu940"},
    { "nick": "Nerchio", "channel": "nerchio"},
    { "nick": "Nightblue", "channel": "nightblue3"},
    { "nick": "NiPGamingTV", "channel": "nipgamingtv"},
    { "nick": "Pal", "channel": "sc2pal"},
    { "nick": "Pidiiinne", "channel": "pidiiinne"},
    { "nick": "Proleague", "channel": "sc2proleague"},
    { "nick": "Pyrionflax", "channel": "pyrionflax"},
    { "nick": "Repomaniak", "channel": "ruzgatogosu"},
    { "nick": "Rodzyn", "channel": "rodzyn12345"},
    { "nick": "Sacsri", "channel": "sacsri"},
    { "nick": "sLh", "channel": "slhosg"},
    { "nick": "snipealot1", "channel": "snipealot1"},
    { "nick": "snipealot2", "channel": "snipealot2"},
    { "nick": "snipealot3", "channel": "snipealot3"},
    { "nick": "snipealot4", "channel": "snipealot4"},
    { "nick": "Soul", "channel": "impsoul"},
    { "nick": "Starcraft_BW_VoDs", "channel": "medrybw"},
    { "nick": "StarladderTV", "channel": "starladder1"},
    { "nick": "TakeTV", "channel": "taketv"},
    { "nick": "Tarson", "channel": "tarsonsc"},
    { "nick": "Tefel", "channel": "tefel"},
    { "nick": "TerranTV", "channel": "terrantv"},
    { "nick": "TheGDStudio", "channel": "thegdstudio"},
    { "nick": "WCS Europe PL", "channel": "wcs_pl"},
    { "nick": "WCS Europe", "channel": "wcs_europe"},
    { "nick": "Wildturtle", "channel": "tsm_wildturtle"},
    { "nick": "Zedd", "channel": "zeddsc"},
    { "nick": "Destiny", "channel": "destiny"},
    { "nick": "RotterdaM", "channel": "rotterdam08"},
    { "nick": "Catz", "channel": "rootcatz"},
];

azubu = [
        { "nick": "MC", "channel": "mc"},
        { "nick": "MVP", "channel": "mvp"},
        { "nick": "Leenock", "channel": "yoefwleenock"},
        { "nick": "Nestea", "channel": "nestea"},
        { "nick": "Artosis", "channel": "artosis"},
        { "nick": "Tasteless", "channel": "tasteless"},
    { "nick": "Gnimsh", "channel": "gnimsh"},
    { "nick": "NesTea", "channel": "nestea"},
    { "nick": "HyuN", "channel": "hyuN"},
    { "nick": "Savjz", "channel": "savjz"},
    { "nick": "Cyanide", "channel": "cyanide"},
    { "nick": "Tsatsulow", "channel": "tsatsulow"},
    { "nick": "Moonglade", "channel": "moonglade"},
    { "nick": "Ragnarok", "channel": "ragnarok"},
];

var BW="";
var SC2="";
var DOTA2="";
var LOL="";
var Others="";    


for (var i=0; i<twitch.length; i++) {
    (function(i) { // protects i in an immediately called function
      $.getJSON("https://api.twitch.tv/kraken/streams/"+twitch[i].channel+".json?callback=?", function (data) {
                if (data.stream != null){
                        if (data.stream.game == "StarCraft: Brood War"){
                if (twitch[i].nick.indexOf("snipealot") !=-1) {
                                        BW+="<a href=http://www.twitch.tv/" + twitch[i].channel + " target='_blank'>" + twitch[i].nick +": " + data.stream.channel.status + "</a> (" + data.stream.viewers + ") <br>";
                                } else {
                        BW+="<a href=http://www.twitch.tv/" + twitch[i].channel + " target='_blank'>" + twitch[i].nick + "</a> (" + data.stream.viewers + ") <br>";
                }
            } else if (data.stream.game == "StarCraft II: Heart of the Swarm"){
                SC2+="<a href=http://www.twitch.tv/" + twitch[i].channel + " target='_blank'>" + twitch[i].nick + "</a> (" + data.stream.viewers + ") <br>";
            } else if (data.stream.game == "Dota 2"){
                DOTA2+="<a href=http://www.twitch.tv/" + twitch[i].channel + " target='_blank'>" + twitch[i].nick + "</a> (" + data.stream.viewers + ") <br>";
            } else if (data.stream.game == "League of Legends"){
                LOL+="<a href=http://www.twitch.tv/" + twitch[i].channel + " target='_blank'>" + twitch[i].nick + "</a> (" + data.stream.viewers + ") <br>";
            } else {
                Others+="<a href=http://www.twitch.tv/" + twitch[i].channel + " target='_blank'>" + twitch[i].nick + "</a> (" + data.stream.viewers + ") <br>";
            }
                }
    document.getElementById("BW").innerHTML=BW + "<br>";
    document.getElementById("SC2").innerHTML=SC2 + "<br>";
    document.getElementById("DOTA2").innerHTML=DOTA2 + "<br>";
    document.getElementById("LOL").innerHTML=LOL + "<br>";
    document.getElementById("Others").innerHTML=Others;        
      });
    })(i);
}

for (var i=0; i<azubu.length; i++) {
    (function(i) { // protects i in an immediately called function
        $.getJSON("http://beta.azubu.tv/api/channel/"+azubu[i].channel+"/get/viewers", function (data) {
                 if (data.data.is_live == true){
            if (data.data.category.name == "starcraft-ii"){
                SC2+="<a href=http://beta.azubu.tv/" + azubu[i].channel + " target='_blank'>" + azubu[i].nick + "</a> (" + data.data.view_count + ") <br>";
            } else if (data.data.category.name == "dota-2"){
                DOTA2+="<a href=http://beta.azubu.tv/" + azubu[i].channel + " target='_blank'>" + azubu[i].nick + "</a> (" + data.data.view_count + ") <br>";
            } else if (data.data.category.name == "league-of-legends"){
                LOL+="<a href=http://beta.azubu.tv/" + azubu[i].channel + " target='_blank'>" + azubu[i].nick + "</a> (" + data.data.view_count + ") <br>";
            } else {
                Others+="<a href=http://beta.azubu.tv/" + azubu[i].channel + " target='_blank'>" + azubu[i].nick + "</a> (" + data.data.view_count + ") <br>";
            }
                }
    document.getElementById("SC2").innerHTML=SC2 + "<br>";
    document.getElementById("DOTA2").innerHTML=DOTA2 + "<br>";
    document.getElementById("LOL").innerHTML=LOL + "<br>";
    document.getElementById("Others").innerHTML=Others;        
      });
    })(i);
}
pending…
Local string based modules
// ==UserScript==
// @name        Netwars Stream List
// @namespace   ds
// @include     http://netwars.pl/*
// @version     0.1
// @grant       none
// @require         http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js
// ==/UserScript==

var div = document.getElementById('stream_list').innerHTML;
document.getElementById('stream_list').innerHTML="";
document.getElementById('stream_list').innerHTML += '<div id="title">StarCraft: Brood War:';
document.getElementById('stream_list').innerHTML += '<div id="BW"></div>';
document.getElementById('stream_list').innerHTML += '</div>';
document.getElementById('stream_list').innerHTML += '<div id="title">StarCraft II: Heart of the Swarm:';
document.getElementById('stream_list').innerHTML += '<div id="SC2"></div>';
document.getElementById('stream_list').innerHTML += '</div>';
document.getElementById('stream_list').innerHTML += '<div id="title">Dota 2:';
document.getElementById('stream_list').innerHTML += '<div id="DOTA2"></div>';
document.getElementById('stream_list').innerHTML += '</div>';
document.getElementById('stream_list').innerHTML += '<div id="title">League of Legends:';
document.getElementById('stream_list').innerHTML += '<div id="LOL"></div>';
document.getElementById('stream_list').innerHTML += '</div>';
document.getElementById('stream_list').innerHTML += '<div id="title">Others:';
document.getElementById('stream_list').innerHTML += '<div id="Others"></div>';
document.getElementById('stream_list').innerHTML += '</div>';

twitch = [
        { "nick": "BeyondTheSummitTV", "channel": "beyondthesummit"},
        { "nick": "BeyondTheSummitTV2", "channel": "beyondthesummit2"},
        { "nick": "Bunny", "channel": "liquidbunny"},
        { "nick": "Center", "channel": "quanticcenter"},
        { "nick": "Dendi", "channel": "dendi"},
        { "nick": "DieStar", "channel": "mdiestar"},
        { "nick": "DOTA2 PL", "channel": "dota2_pl"},
        { "nick": "Draskyl", "channel": "draskyl"},
        { "nick": "DreamHack", "channel": "dreamhacksc2"},
        { "nick": "ESL.TV SC2", "channel": "esltv_sc2"},
        { "nick": "Fragbite Masters", "channel": "fragbitelive"},
        { "nick": "HerO", "channel": "liquidhero"},
        { "nick": "INnoVation", "channel": "acerinnovation"},
        { "nick": "itsHafu", "channel": "itshafu"},
        { "nick": "Jaedong", "channel": "egjd"},
        { "nick": "joinDOTABlue", "channel": "joindotablue"},
        { "nick": "joinDOTARed", "channel": "joindotared"},
        { "nick": "Koget", "channel": "kogetbw"},
        { "nick": "Marwin", "channel": "ifumarwin"},
        { "nick": "MaSsanSC", "channel": "massansc"},
        { "nick": "MMA", "channel": "acermma"},
        { "nick": "Nathanias", "channel": "nathanias"},
        { "nick": "Patience", "channel": "azubupatience"},
        { "nick": "Pike", "channel": "pikepl"},
        { "nick": "Polt", "channel": "polt"},
        { "nick": "Scarlett", "channel": "scarlettm"},
        { "nick": "Selendis", "channel": "selendissc"},
        { "nick": "SingSing", "channel": "sing_sing"},
        { "nick": "Snute", "channel": "liquidsnute"},
        { "nick": "Stephano", "channel": "egstephano"},
        { "nick": "TaeJa", "channel": "liquidtaeja"},
        { "nick": "TLO", "channel": "liquidtlo"},
        { "nick": "Totalbiscuit", "channel": "totalbiscuit"},
        { "nick": "trutaCz", "channel": "trutaacz"},
        { "nick": "WCS Europe 2", "channel": "wcs_europe2"},
        { "nick": "WingsOfDeath", "channel": "wingsofdeath"},
        { "nick": "Zazu", "channel": "zazu__"},
    { "nick": "Arteezy", "channel": "arteezy"},
    { "nick": "BasetradeTV", "channel": "basetradetv"},
    { "nick": "Bjergsen", "channel": "tsm_bjergsen"},
    { "nick": "Cella", "channel": "slayerscella"},
    { "nick": "ChanmanV", "channel": "chanmanv"},
    { "nick": "Chaox", "channel": "chaoxlol"},
    { "nick": "Elazer", "channel": "osomfire"},
    { "nick": "emsc2tv", "channel": "emstarcraft"},
    { "nick": "ESGN TV", "channel": "esgn_tv"},
    { "nick": "ESL.TV PL SC2", "channel": "esltvpl_sc2"},
    { "nick": "Forgg", "channel": "forgg"},
    { "nick": "Funkay", "channel": "funkay_sc "},
    { "nick": "Gieco", "channel": "giecotv"},
    { "nick": "GOM EXP", "channel": "gsl"},
    { "nick": "Indy", "channel": "indystarcraft"},
    { "nick": "Journey", "channel": "journey92"},
    { "nick": "KDL EN", "channel": "kdl_en"},
    { "nick": "Khaldor", "channel": "khaldor"},
    { "nick": "Koget", "channel": "kogetbw"},
    { "nick": "Kripparrian", "channel": "nl_kripp"},
    { "nick": "MaNa", "channel": "liquidmana"},
    { "nick": "Mestru", "channel": "mestru"},
    { "nick": "Michus", "channel": "castplay"},
    { "nick": "Miszu", "channel": "miszu94"},
    { "nick": "Nebu", "channel": "nebu940"},
    { "nick": "Nerchio", "channel": "nerchio"},
    { "nick": "Nightblue", "channel": "nightblue3"},
    { "nick": "NiPGamingTV", "channel": "nipgamingtv"},
    { "nick": "Pal", "channel": "sc2pal"},
    { "nick": "Pidiiinne", "channel": "pidiiinne"},
    { "nick": "Proleague", "channel": "sc2proleague"},
    { "nick": "Pyrionflax", "channel": "pyrionflax"},
    { "nick": "Repomaniak", "channel": "ruzgatogosu"},
    { "nick": "Rodzyn", "channel": "rodzyn12345"},
    { "nick": "Sacsri", "channel": "sacsri"},
    { "nick": "sLh", "channel": "slhosg"},
    { "nick": "snipealot1", "channel": "snipealot1"},
    { "nick": "snipealot2", "channel": "snipealot2"},
    { "nick": "snipealot3", "channel": "snipealot3"},
    { "nick": "snipealot4", "channel": "snipealot4"},
    { "nick": "Soul", "channel": "impsoul"},
    { "nick": "Starcraft_BW_VoDs", "channel": "medrybw"},
    { "nick": "StarladderTV", "channel": "starladder1"},
    { "nick": "TakeTV", "channel": "taketv"},
    { "nick": "Tarson", "channel": "tarsonsc"},
    { "nick": "Tefel", "channel": "tefel"},
    { "nick": "TerranTV", "channel": "terrantv"},
    { "nick": "TheGDStudio", "channel": "thegdstudio"},
    { "nick": "WCS Europe PL", "channel": "wcs_pl"},
    { "nick": "WCS Europe", "channel": "wcs_europe"},
    { "nick": "Wildturtle", "channel": "tsm_wildturtle"},
    { "nick": "Zedd", "channel": "zeddsc"},
    { "nick": "Destiny", "channel": "destiny"},
    { "nick": "RotterdaM", "channel": "rotterdam08"},
    { "nick": "Catz", "channel": "rootcatz"},
];

azubu = [
        { "nick": "MC", "channel": "mc"},
        { "nick": "MVP", "channel": "mvp"},
        { "nick": "Leenock", "channel": "yoefwleenock"},
        { "nick": "Nestea", "channel": "nestea"},
        { "nick": "Artosis", "channel": "artosis"},
        { "nick": "Tasteless", "channel": "tasteless"},
    { "nick": "Gnimsh", "channel": "gnimsh"},
    { "nick": "NesTea", "channel": "nestea"},
    { "nick": "HyuN", "channel": "hyuN"},
    { "nick": "Savjz", "channel": "savjz"},
    { "nick": "Cyanide", "channel": "cyanide"},
    { "nick": "Tsatsulow", "channel": "tsatsulow"},
    { "nick": "Moonglade", "channel": "moonglade"},
    { "nick": "Ragnarok", "channel": "ragnarok"},
];

var BW="";
var SC2="";
var DOTA2="";
var LOL="";
var Others="";    


for (var i=0; i<twitch.length; i++) {
    (function(i) { // protects i in an immediately called function
      $.getJSON("https://api.twitch.tv/kraken/streams/"+twitch[i].channel+".json?callback=?", function (data) {
                if (data.stream != null){
            var title = data.stream.channel.status;
            var channel = twitch[i].channel;
            var nick = twitch[i].nick;
            var viewers = data.stream.viewers;
                        if (data.stream.game == "StarCraft: Brood War"){
                if (nick.indexOf("snipealot") !=-1) {
                                        BW+="<a href=http://www.twitch.tv/" + channel + " target='_blank'>" + nick +": " + title + "</a> (" + viewers + ") <br>";
                                } else {
                        BW+="<a href=http://www.twitch.tv/" + channel + " target='_blank'>" + nick + "</a> (" + viewers + ") <br>";
                }
            } else if (data.stream.game == "StarCraft II: Heart of the Swarm"){
                SC2+="<a href=http://www.twitch.tv/" + channel + " target='_blank'>" + nick + "</a> (" + viewers + ") <br>";
            } else if (data.stream.game == "Dota 2"){
                DOTA2+="<a href=http://www.twitch.tv/" + channel + " target='_blank'>" + nick + "</a> (" + viewers + ") <br>";
            } else if (data.stream.game == "League of Legends"){
                LOL+="<a href=http://www.twitch.tv/" + channel + " target='_blank'>" + nick + "</a> (" + viewers + ") <br>";
            } else {
                Others+="<a href=http://www.twitch.tv/" + channel + " target='_blank'>" + nick + "</a> (" + viewers + ") <br>";
            }
                }
    document.getElementById("BW").innerHTML=BW + "<br>";
    document.getElementById("SC2").innerHTML=SC2 + "<br>";
    document.getElementById("DOTA2").innerHTML=DOTA2 + "<br>";
    document.getElementById("LOL").innerHTML=LOL + "<br>";
    document.getElementById("Others").innerHTML=Others;        
      });
    })(i);
}

for (var i=0; i<azubu.length; i++) {
    (function(i) { // protects i in an immediately called function
        $.getJSON("http://beta.azubu.tv/api/channel/"+azubu[i].channel+"/get/viewers", function (data) {
                 if (data.data.is_live == true){
            if (data.data.category.name == "starcraft-ii"){
                SC2+="<a href=http://beta.azubu.tv/" + azubu[i].channel + " target='_blank'>" + azubu[i].nick + "</a> (" + data.data.view_count + ") <br>";
            } else if (data.data.category.name == "dota-2"){
                DOTA2+="<a href=http://beta.azubu.tv/" + azubu[i].channel + " target='_blank'>" + azubu[i].nick + "</a> (" + data.data.view_count + ") <br>";
            } else if (data.data.category.name == "league-of-legends"){
                LOL+="<a href=http://beta.azubu.tv/" + azubu[i].channel + " target='_blank'>" + azubu[i].nick + "</a> (" + data.data.view_count + ") <br>";
            } else {
                Others+="<a href=http://beta.azubu.tv/" + azubu[i].channel + " target='_blank'>" + azubu[i].nick + "</a> (" + data.data.view_count + ") <br>";
            }
                }
    document.getElementById("SC2").innerHTML=SC2 + "<br>";
    document.getElementById("DOTA2").innerHTML=DOTA2 + "<br>";
    document.getElementById("LOL").innerHTML=LOL + "<br>";
    document.getElementById("Others").innerHTML=Others;        
      });
    })(i);
}
pending…

Compare results of other browsers

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:

0 comments

Add a comment