javascript: var isXHTML=/html\:/.test(document.getElementsByTagName('body')[0].nodeName); function createNewEle(ele){ if(isXHTML) { return document.createElementNS('http://www.w3.org/1999/xhtml', ele); } else { return document.createElement(ele); }; }; function setStyle(string) { var ele=createNewEle('link'); ele.rel='stylesheet'; ele.type='text/css'; ele.href='data:text/css;charset=utf-8,'+escape(string); document.getElementsByTagName('head')[0].appendChild(ele); } (function (){ var c=window.open('','','height=400,width='+window.innerWidth*.5+',top='+(window.innerHeight-(400+10))+',left='+(window.innerWidth*.5-30)+',resizable=yes,location=no'); c.document.open(); c.document.write(''+ ''+ ''+ 'css console '+document.title+''+ '
'+ '

history:

'+ '

'+ ''+ ''+ ''+ ''+ '

'); c.document.close(); })()