Failed to execute ‘getComputedStyle’ on ‘Window’ jQuery使用过程中报错
在写js的过程中,遇到了Failed to execute ‘getComputedStyle’ on ‘Window’的报错,原因很简单,就是我通过选择器定位的元素其实根本不存在!
本来要定位 $(“body #node2”),写了$(“body #node2”).show(),但页面上根本没有id为node2的元素在,然后就报出这样的错。。。希望我下次能仔细点。。。
但是!!写 $(“body #node2”).hide()是完全没有问题的,即使元素不存在。。。