mootools_MooTools窗口对象转储

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的控制台中,但是以上内容在所有浏览器中均适用。

翻译自: https://davidwalsh.name/window-object-dump

mootools

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值