我有下面一段代码,经过测试,它在 IE8 中不起作用。我让它在 IE11 和 Chrome 上运行并且运行完美。我已经调试了 IE8 中的代码,它指向“console.log 作为问题区域。 最有趣的是,当我开始在 IE8 中调试 JS 时——它启动了它,这段代码开始工作。再一次,在离开调试、关闭并重新打开文件时——同样的故事,直到你进入调试)))。
jQuery(function () {
$('.Response input[type=radio]').change(function () {
console.log(this.value)
if (this.value == 'Y' || this.value == 'NA' || this.value == 'NS') {
$(this).closest('.ui-accordion-content').prev().css("background", "#AADDB2");
} else if (this.value == 'N') {
$(this).closest('.ui-accordion-content').prev().css("background", "#FFC5C5");
}
});
});
有什么想法吗?感谢您的帮助。 附言。不幸的是,用户“必须”使用 IE8 并且升级不是一种选择(((。 提前谢谢你)))
最佳答案
您可以使用 console.log 防止 ie8 错误
if (!window.console){ console = {log: function() {}} };
关于javascript - IE8 控制台.log,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22103156/