Web development

Form layout using negative margins on 27 Jul 08 (1 comment)

Use negative margins and light weight semantic markup to display a form with the labels on one side and form elements on the other. No tables or divs needed at all. Works in all browsers. Noone who wasn’t a web developer would believe what a pain it is finding a good solution to this little problem.

The bleeding edge of web: media queries on 18 Jul 08 (5 comments)

Media queries are extra params for the CSS @media types that you can use to target styles for different devices based the device’s capabilities like dimensions and colour depth. They are part of the W3C CSS3 standard and are supported in the latest vesion of Opera (desktop and mini versions), Firefox and Safari. Media queries [...]

The bleeding edge of web: querySelector() and querySelectorAll() on 12 Jul 08 (Add comment)

One thing coming up in the W3C selectors api spec are a couple of new methods for retrieving DOM elements called querySelector() and querySelectorAll() that take a css selector and return a node or list of nodes that match. They basically do the same thing as the css query features of JQuery or Dean Edward’s [...]

Del.icio.us: not responsible for the cancellation of Stargate on 07 Jul 08 (Add comment)

The FAQ on del.icio.us made me laugh: (I wonder if they could do something about the new X-Files movie next…?)

Debugging pages in Safari on 05 Jul 08 (Add comment)

I’m getting quite interested in Safari because it seems to be where a lot of the early implementations of interesting new standards is happening. It makes me happy to get a little glimpse at what the future of web development might look like. :) The problem is Firefox has really spoilt me with all it’s [...]

Switching opera desktop to hand held mode for testing on 11 May 08 (1 comment)

Neat little tip I found (in my old, old blog archives) is that you can switch Opera into hand held emulation mode by hitting Shift+F11. It’ll take your site and serialize the design to fit on a small screen like on your phone: It also will honour the @media handheld stylesheet so it’s a convenient [...]

Firefox mouse gestures on 02 May 08 (3 comments)

One of the guys at work inspired me to try a mouse gestures plugins for Firefox today. For the uninitiated, mouse gestures are like keyboard shortcuts for the mouse. Instead of holding ctrl+c, you do a little drawing on the screen while holding down the right mouse button to make something happen. For example when [...]

JSAN open source code repository on (Add comment)

Learnt something new today! There’s a repository of open source javascript code called JSAN modelled on the perl version. There’s a whole lot of interesting stuff on there like UI widgets, animations and AJAX. I haven’t tried any but it’s nice to know there’s somewhere you can see what other people are doing.

Objects, event handlers and "this" in javascript on 26 Apr 08 (7 comments)

One recurring problem I’ve had when using a function from a custom javascript object as an event handler is that when the event handler is called the “this” property of the function no longer references the object it originally belonged to. To show you what I mean, take a look at this simple javascript object. [...]

First impressions of gmail – maybe the end of desktop mail for me on 24 Apr 08 (3 comments)

Today I found out that gmail supports checking and storing POP3 mail and it made me wonder if I even need a desktop email client any more. It has everything I use in Thunderbird (sorting, filtering, searching, address book) with the big advantage of being on the network and therefore accessible from any computer. So [...]

Focus event handler run in different order in IE than Firefox on 16 Jan 08 (4 comments)

I wanted to document a bit of an edge case browser incompatibility that I found: that event handlers aren’t always run in the same order in IE as they do in other browsers. It’s a bit of a strange case where we were doing something not entirely sensible. :) There was an input box which [...]

Firefox crash recovery: I am in love on 14 Oct 07 (Add comment)

Ok, I’m now officially in love with Firefox. My Vista install has mysteriously become flaky recently and is randomly taking down programs. When Firefox crashed, not only did it remember which tabs I had open, it also remembered the contents of what was in the form that I was filling in at the time of [...]

Extreme nesting experiment in IE and Firefox on 04 Aug 07 (2 comments)

On the ever interesting topic of curiosity over good sense, I had an interesting discussion about how far you can nest HTML tables in different browsers. The person I was talking to had noticed that at a certain point the tables just stopped displaying when they tried to take their web rendering to an extreme [...]

Internet hype technology of the week: Silverlight on 19 May 07 (Add comment)

Microsoft is amazing. WPF/E has been around for ages. They give it a fancy name and run a keynote about it at MIX and suddenly it’s the biggest thing to hit (Microsoft) web development since someone came up with a catchy name for ajax. This week it seems like its the only thing that anyone [...]

IE bug logging database not being reopened on 13 May 07 (Add comment)

I was a bit disappointed when I read that public IE bug database isn’t being reopened. The reason given was that the volume of unusable bug reports submitted far outweighed the useful stuff. Apparently some people used it to tell the team how much they hate IE. :) I can understand that being a problem [...]

Spanning javascript strings across multiple lines on (3 comments)

I came across a weird feature of javascript last week, a way of spanning javascript strings over multiple lines. To do it you put a ‘\’ character just before the line break and javascript knows it should keep going on the next line: var mystring = "hello \               [...]

firebug-stack-trace DIY javascript stack trace on 12 May 07 (12 comments)

How to use arguments.callee to walk up the javascript call stack when you’re doing something that a debugger can’t help you with.

Interesting side affect of creating DOM objects using innerHTML on 15 Mar 07 (Add comment)

It’s ER night again tonight so I’m going to update with a totally dorky technical web thing I did today that I thought was interesting. :) I found a strange IE behaviour today in a sample I was looking at. The problem was with a javascript object that had a reference to a DOM object. [...]

View Rendered Source in IE on 06 Feb 07 (1 comment)

I’m doing a lot of work with javascript that modifies the DOM so I really like tools like the Firefox rendered source chart plugin so I can see what’s actually going on in my page. Rendered source chart in particular is a very slick plugin. It not only takes everything in the DOM and shows [...]

Javascript lint – saviour of mortal developers on 05 Feb 07 (Add comment)

Something I really, really love at the moment is a little application called javascript lint. It’s a javascript syntax checker that’s built on top of the Mozilla javascript engine. You can run it over a javascript include file (I don’t know if it’ll work on inline javascript) and it’ll syntax check it for you without [...]

Child and sibling selectors on 20 Jan 07 (Add comment)

I was trying to style a bit of html without having to add a new class into the markup and came across two types of CSS selectors that I haven’t used before called child and sibling selectors. You can use child selectors to target the direct children of an element. The syntax is parent > [...]

IE6 is the new NS4.7 on 14 Nov 06 (Add comment)

I’ve been playing around with CSS support in IE7 all day and I’m so happy to see some of the really, really long standing things that have been finally fixed! The thing that makes me happiest is that you can finally do real work with absolute positioning because it finally supports the bottom and right [...]

I'm finished my new blog engine! (build vs buy) on 11 Oct 06 (Add comment)

Yay! Finally I’ve finished all the basic functionality for my new blog scripts after months trying to find development time between visiting Australia, moving house, building Ikea furniture and showing my parents around London. Hopefully I’ll get it live sometime between now and the end of the month. The best part for me is that [...]

Why accessibility is important on 02 Sep 06 (1 comment)

Last time I wanted to update my McAfee virus subscription they told me that I couldn’t download the latest version of the software using Firefox. The only option I had to download the software was to use IE. I couldn’t find another way to download the product. So say we take a fairly conservative view [...]

Novel use of google maps on 08 Aug 06 (Add comment)

This has to be the most novel use of Google maps ever :D