我试图搜索这个但无济于事。我拥有的代码是由网站上一个非常好的人提供的,然后我修改了属性以使我适合的元素适合他们需要去的地方,但是,在所有浏览器中一切正常,也就是说,除了 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.
无论如何,debug
和log
只是为了将调试信息打印到控制台——它们应该从生产代码中移除。
关于javascript - 脚本 438 : Object doesn't support property or method 'debug' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13158470/