JavaScript console log in Magento

后端 未结 9 1661
长发绾君心
长发绾君心 2020-12-09 11:46

I have a custom phtml pages in Magento. As far I know Magento uses jQuery and prototype libraries.

For example, if I need external jQuery/jQueryUI, I need t

9条回答
  •  一生所求
    2020-12-09 11:49

    In the file js.js there is this code :

    if (!("console" in window) || !("firebug" in console))
    {
        var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml",
        "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
    
        window.console = {};
        for (var i = 0; i < names.length; ++i)
            window.console[names[i]] = function() {}
    }
    

    So what it actually does, if the console is not the firebug console (in firefox) , it deactivate it. So in the built in console of google chrome, it doesn't work.

    There is 2 options : Use firefox with firebug , or remove this block of code.

提交回复
热议问题