javascript - switch not working

Posted by Fernando SBS on Stack Overflow See other posts from Stack Overflow or by Fernando SBS
Published on 2010-06-14T18:49:10Z Indexed on 2010/06/14 18:52 UTC
Read the original article Hit count: 186

Filed under:
|
|
function FM_log(level, text) {

    // caso não seja log total escolhe o que loga
    var log = false;
    switch (level) {
        case "addtoprio()":log = true;
        case "alternaTropas()":log = false;
        case "sendtroops()":log = false;
        defalt: log = false;
    }

    if ((logTotal == false) && (log == true))
        GM_log(horaAtual() + " - "+level+", "+text);
    else if (logTotal == true)
        GM_log(horaAtual() + " - "+level+", "+text);    
}

how to do that switch is a way it works?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about string