var d = document.getElementById; var s = d("demo").innerHTML; alert(s); // IE 没有问题,其他浏览器必须指定上下文 var d = document.getElementById; var s = d.call(window, "demo").innerHTML alert(s);
var d = document.getElementById; var s = d("demo").innerHTML; alert(s); // IE 没有问题,其他浏览器必须指定上下文 var d = document.getElementById; var s = d.call(window, "demo").innerHTML alert(s);