console.log(everything)

I’m currently adding a javascript feature to a page of a site that’s terribly designed (runs on an ancient PHP CMS built in the year 2000 in PHP 4), and terribly implemented, with far too much going on in a way that it shouldn’t.

Anyway, I wanted to see if there was already a javascript value set for the data I required. Here’s how you dump every single JS variable to the console.log() :

for (var b in window) { 
    if (window.hasOwnProperty(b)) {
        console.log(b); 
    }
}

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s