IE8中的Console.log [英] Console.log in IE8
问题描述
我有下面的代码,经过测试,在IE8中不起作用。我在IE11和Chrome上运行它运行得很好。我已经调试了IE8中的代码,它指向console.log作为问题区域。
最有趣的是,当我开始在IE8中调试JS时 - 它踢它并且这段代码开始工作。然后再次,在离开调试,关闭和重新打开文件 - 同样的故事,直到你进入调试)))。
I have below piece of code, which, when tested, does not work in IE8. I have it running on IE11 and Chrome and it runs perfectly. I have debugged the code in IE8 which points at "console.log as a problem area. The most interesting thing is that when I start debugging JS in IE8 - it kicks it and this piece of code start working. Then again, on leaving debugging, closing and re-opening file - same story until you get into debugging))).
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");
}
});
});
任何想法?会很感激你的帮助。
PS。不幸的是,用户有点必须使用IE8并且升级不是一种选择( ((。
提前谢谢)))
Any ideas? Would appreciate yr help. PS. Unfortunately, user kind of "must" use IE8 and upgrading is not an option(((. Thank you in advance)))
推荐答案
你可以使用<阻止console.log上的ie8错误/ p>
you can prevent ie8 errors on console.log with
if (!window.console){ console = {log: function() {}} };
这篇关于IE8中的Console.log的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!