Category Archives: Javascript

Change CSS styles at the root.

When building web applications a lot of times a certain elements style needs to be changed. Mostly you can suffice by using one of the Element.classList methods.
But sometimes you have to set an elements style directly (think of non-constant values like width, height, padding etc…). This is fine for single elements but when dealing with a bunch of them it feels wrong and slow having to loop through each of them.

Read the rest

Bookmarklet for fullscreen Google Maps

As a developer I use bookmarklets all the time. For those of you who don’t know: a bookmarklet is similar to a bookmark but instead of a hyperlink it points to: “javascript:console.log(‘…do some Javacript to alter the page you’re currently viewing’);”.
So when developing I tend to use it for lots of stuff: quick login into a secure part, automatically fill forms with random data, altering data I get from some site… I even used it to load and initialize the level editor for a game I recently built.

Read the rest