MooTools Window Object Dumping
Ever want to see all of the information stored within the window property of your browser? Here's your chance.
The XHTML
<div id="console"></div>
We need a wrapper DIV that we'll consider a console.
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.
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.
Fun! You could opt to just log all of this to Firebug's console but the above works in all browsers.
Firefox OS is all over the tech news and for good reason: Mozilla's finally given web developers the platform that they need to create apps the way they've been creating them for years -- with CSS, HTML, and JavaScript. Firefox OS has been rapidly improving...
Kids these days, I tell ya. All they care about is the technology. The video games. The bottled water. Oh, and the texting, always the texting. Back in my day, all we had was...OK, I had all of these things too. But I still don't get...
A few weeks back I wrote an article about MooTools Link Nudging, which is essentially a classy, subtle link animation achieved by adding left padding on mouseover and removing it on mouseout. Here's how to do it using jQuery:
The jQuery JavaScript
It's important to keep...
For the longest time, developers were frustrated by elements with overflow not being scrollable within the page of iOS Safari. For my blog it was particularly frustrating because I display my demos in sandboxed IFRAMEs on top of the article itself, so as to not affect my site's...
This is really helpful. I find myself doing something similar all the time. But usually I am
console.log
-ingJSON.encode(window)
which does not look very niceHey David, that’s pretty cool, I like it!