修改blink函数为:
function blink() {
var temp = document.getElementById("soccer");
temp.style.visibility = (temp.style.visibility == "hidden") ? "visible" : "hidden";
counter += 1;
setTimeout("blink()", msecs);
}
原来的函数实现直接通过ID来引用一个对象,下面是警告信息:
Warning: Element referenced by ID/NAME in the global scope. Use W3C standard document.getElementById() instead.