javascript - 脚本 438 : Object doesn't support property or method 'debug'

标签 javascript internet-explorer

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

SCRIPT438: Object doesn't support property or method '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"
            });
        }
    });
}

有问题的具体行是

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

或者至少 IE 是这么说的

是否有解决此问题和 IE 的方法 - 我正在慢慢学习 - 但这超出了我所知道的范围。我在 google 和此处搜索了调试错误,但找不到任何内容。

站点是http://www.crazyedits.co.uk

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

最佳答案

根据 the documentation , console.debug 已弃用;应改用 console.log

An alias for log(); this was added to improve compatibility with existing sites already using debug(). However, you should use console.log() instead.

无论如何,debuglog 只是为了将调试信息打印到控制台——它们应该从生产代码中移除。

关于javascript - 脚本 438 : Object doesn't support property or method 'debug' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13158470/

相关文章:

css - IE 兼容模式下的 Kendo UI - 滚动面板栏

javascript - 邮资计算器无法在 IE 中输出

html - <选项选择 = "selected"> IE9 中的问题

css - 关键帧中的背景图像在 Firefox 或 Internet Explorer 中不显示

javascript - 通过包导入删除 TinyMCE 注册消息

javascript - 无法阻止表单以空输入提交

javascript - .wrap() 与调整大小函数一起使用时多次添加选择器

javascript - On Span Click - 通过页面刷新将行插入 MySQL

javascript - 在 JavaScript 中访问 JSON 对象中的数组

css - 我可以制作一个本地样式表,基本上从我访问的页面中删除所有 CSS 吗?