5

我试图搜索这个但无济于事。我的代码是由网站上的一个真正的好人提供的,然后我修改了属性以使我的元素适合他们需要去的地方,但是,在所有浏览器中一切正常,也就是说,除了 IE - 漂亮几乎所有版本。我在 IE9 中运行调试并收到此错误“

SCRIPT438:对象不支持属性或方法“调试”

它引用的代码部分是这个

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"
            });
        }
    });
}

有问题的特定行是

console.debug('resize content (' + (viewPortWidth - 160) + ')');

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

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

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

预先感谢您在此问题上提供的任何帮助。

4

1 回答 1

8

根据文档console.debug已弃用;console.log应改为使用。

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

在任何情况下,debuglog用于将调试信息打印到控制台 - 它们应该从生产代码中删除。

于 2012-10-31T13:11:11.167 回答