标签:this create java element var ring div param back
(function(){ var print={ lock:true, log:function(param){ if(this.lock){ var element=document.createElement("div"); element.style.background=‘green‘ element.style.fontSize=‘20px‘ switch (typeof param){ case "string" :element.innerHTML=param;break; case "object":element.innerHTML=JSON.stringify(param);break; } document.body.appendChild(element) } } } window.console=print; })(window) console.log("我哦我我我我我我我哦我") console.log({name:"张三",age:15})
为了方便h5页面在app上调试看到打印的日志 重写window.console
标签:this create java element var ring div param back
原文地址:http://www.cnblogs.com/liuhao-web/p/6912087.html