andrew.hedges.name / blog

Topic: JavaScript

Responsive iframes in pure CSS

December 15, 2015, 12:15 pm

On a recent freelance gig, I needed to integrate a Tumblr feed that included YouTube videos into a fully responsive website. The videos are contained in…wait for it…. Lovely.

Dude. Mikeyy can’t even spell his own name.

April 12, 2009, 5:51 am

Yeah, I got p0wnd by the Mikeyy Worm on Twitter. It’s a simple JavaScript injection attack. You get it by visiting an infected person’s profile with JavaScript turned on in your web browser. Here’s how to stop the madness.

Numerical array sorting in JavaScript

August 26, 2008, 8:26 pm

In these troubled times, it can be hard to know whom to trust. In looking for a numerical sort function, the first two articles I found both recommended the same syntax. Both of them were wrong.

Widget JavaScript, the Un-series: Part 0 (Namespacing and the Module Pattern)

May 13, 2008, 3:45 pm

I’m not big on series of blog posts. Others have done it successfully, but personally I’ve promised this kind of thing before and not delivered. So, I’m not making any promises that this series will get past Part 0, but please know I have the best of intentions. If all goes as hoped, over the next however-many posts I will provide a few useful JavaScript code snippets that Dashboard widget authors can take and easily adapt to their own needs. This is based on my experience authoring nearly 20 widgets over the last 3 years. As you can imagine, some patterns have emerged. In this pre-series post, I will discuss a couple of concepts important to understanding my examples (you know, if I get around to posting them): namespacing and the module pattern.

Handling Hash

February 12, 2008, 2:12 pm

No, I’m not talking about drug smuggling. I’m talking about the inconsistencies in how The Big 3 web browsers deal with window.location.hash.

The need for speed: innerHTML versus DOM manipulation

July 3, 2007, 9:21 pm

At work, I’ve been tackling some fairly sophisticated JavaScript DOM manipulation scenarios. As such, I’ve started to run up against the limitations of my long-used technique of stuffing loads of HTML as a string into some element’s innerHTML property. Specifically, when inserting very long strings containing complex HTML, there can be a troublesome delay between when JavaScript thinks it’s done inserting the elements and when the elements are actually available for further manipulation.