SCRIPT438:对象不支持属性或方法'debug'

Ton*_*lis 5 javascript internet-explorer

我试图搜索这个但无济于事.我的代码由网站上一个真正的好人提供,然后我修改了属性,使我适合他们需要去的地方的元素,但是,一切在所有浏览器中工作正常,即除了IE - 漂亮很多版本.我在IE9中运行调试,并给出了此错误"

SCRIPT438:对象不支持属性或方法'debug'

它引用的代码部分就是这个

function resizeContent() {
    // Retrieve the window width
    var viewPortWidth = $(document).width();
    var viewPortHeight = $(document).height();

    $(".content").each(function(index, element) {

        var jElement = $(this);
        if (jElement.hasClass(currentContentColor)) {
            console.debug('resize content selected (' + (viewPortWidth - 160) + ')');
            // If current content, juste resize the width and height
            jElement.css({
                width: (viewPortWidth - 160) + "px",
                height: viewPortHeight + "px"
            });
        }
        else {
            console.debug('resize content (' + (viewPortWidth - 160) + ')');
            // If not current content, resize with, height and left position
            // (keep content outside)
            jElement.css({
                width: (viewPortWidth - 160) + "px",
                left: viewPortWidth + "px",
                height: viewPortHeight + "px"
            });
        }
    });
}
Run Code Online (Sandbox Code Playgroud)

有问题的具体行是

console.debug('resize content (' + (viewPortWidth - 160) + ')');
Run Code Online (Sandbox Code Playgroud)

或者至少这是IE所说的问题

是否有解决这个问题和IE的问题 - 我正在慢慢学习 - 但这超出了我所知道的范围.我搜索谷歌和这里的调试错误,但找不到任何东西.

该网站是http://www.crazyedits.co.uk

提前感谢您在此问题上提供的任何帮助.

jba*_*bey 8

根据文档,console.debug已被弃用; console.log应该用来代替.

log()的别名; 添加此项是为了改善与已使用debug()的现有站点的兼容性.但是,您应该使用console.log().

在任何情况下,debug并且log只是打印调试信息发送到控制台-他们应该从生产代码中删除.