mootools
Ever want to see all of the information stored within the window property of your browser? Here's your chance.
是否曾经想查看存储在浏览器的window属性中的所有信息? 这是您的机会。
XHTML (The XHTML)
<div id="console"></div>
We need a wrapper DIV that we'll consider a console.
我们需要一个包装DIV,我们将把它当作一个控制台。
CSS (The CSS)
#console pre { font-family:Courier; font-size:11px; background:#000; color:lightgreen; margin:0 0 20px 0; padding:10px; }
#console h3 { color:navy; padding:3px 0; }
I like making this look like a command-line console.
我喜欢使它看起来像命令行控制台。
MooTools JavaScript (The MooTools JavaScript)
window.addEvent('domready',function() {
new Hash(window).each(function(value,property) {
new Element('h3',{ text: property }).inject('console');
new Element('pre',{ text: value }).inject('console');
});
});
Depending on what you have loaded into the page as a JavaScript framework, the amount stored within the window object will vary.
根据您作为JavaScript框架加载到页面中的内容,窗口对象中存储的数量会有所不同。
Fun! You could opt to just log all of this to Firebug's console but the above works in all browsers.
好玩! 您可以选择仅将所有这些记录到Firebug的控制台中,但是以上内容在所有浏览器中均适用。
mootools