IE中无控制台输出功能,IEConsole.js可以解决使用输出: console.log(xxxxx);
if(!window.console){
console = (function(){
var instance = null;
function Constructor(){
var top = document.body.scrollHeight;
this.div = document.createElement("console");
this.div.id = "console";
this.div.style.cssText = "filter:alpha(opacity=80);position:absolute;top:top;left:0px;width:100%;border:1px solid #ccc;background:#eee;";
document.body.appendChild(this.div);
}
Constructor.prototype = {
log : function(str){
var p = document.createElement("p");
p.innerHTML = str;
this.div.appendChild(p);
}
}
function getInstance(){
if(instance == null){
instance = new Constructor();
}
return instance;
}
return getInstance();
})()
}