Web development
In languages like C# and Java you never really need to give a thought to the this operator. In javascript things are a little more complicated due to functions being first class objects.
Published in Javascript, Web development on Sunday, November 29th, 2009
Firefox 3.6 supports multiple background images so I thought it was time to give them a go and figure out how they work. May contain small rant about beautiful markup.
Published in CSS on Monday, November 23rd, 2009
A small browser quirk for IE6 where absolute positioning with the CSS right property is one pixel out when the parent container has an odd number of pixels.
Published in Browser quirks, CSS on Monday, September 7th, 2009
How to use a tool called Packer.NET to build javascript minification into a MSBuild script.
Published in ASP.NET, CSS, Javascript, Tools on Saturday, August 29th, 2009
I don't much like reset stylesheets. They make extra work when creating CSS and are an extra request for the browser to make to build a page.
Published in CSS on Sunday, August 23rd, 2009
Prototype chaining is used to build new types of objects based on existing ones. It has a very similar job to inheritance in a class based language.
Published in Javascript on Monday, August 17th, 2009
Experimenting with using an SVG image as a CSS background image.
Published in CSS on Wednesday, August 12th, 2009
Inline-block is a halfway point between setting an element's display to inline or to block. It keeps the element in the inline flow of the document like display:inline does, but you can manipulate the element's box attributes (width, height and vertical margins) like you can with display:block.
Published in CSS on Sunday, August 9th, 2009
The story of how Joe and I used our favourite web tools to organise our wedding and share the experience with the people who couldn't be there.
Published in Tools, Web development on Saturday, August 1st, 2009
The javascript object prototype is javascript’s way of sharing implementation across similar objects, much like the way classes are used to do this in many other languages. Although constructor functions look a lot like classes, javascript does not have a class based object system like C# or Java. Instead it has a prototype based object [...]
Published in Javascript on Sunday, January 18th, 2009
A neat little trick I learnt from Ting is a way to check whether a value was null or undefined using the or operator (||). It’s really simple. If valueThatMightBeEmpty has a value set, you get that value. If it is null you get the default. It’s just like the ?? operator in C#: var [...]
Published in Javascript on Tuesday, December 9th, 2008
One problem I’ve had a couple of times when using Firebug to show things during code demos is I haven’t been able to make the font big enough for people at the back to read it. I found the solution at stack overflow: 1. Open firebug in new window 2. Go to the view->text size [...]
Published in Tools on Sunday, November 16th, 2008
My find for today was a Firefox extension called Dust-Me Selectors from the SitePoint guys that scans a web site looking for unused selectors in the CSS. It extracts the style references for the current page and then looks at the page to see where they are used. It can look at the current page [...]
Published in CSS, Tools on Tuesday, October 21st, 2008
CSS3 is going to include a new attribute called box-sizing so we can choose whether the width set on an element will include borders and padding or whether borders and paddings will be added to the width. The difference is basically the difference between the IE5 and W3C box models. The default will still be [...]
Published in CSS on Monday, October 20th, 2008
Javascript closures are a really powerful feature of the javascript language. Closures are created when a function that’s nested inside another function accesses a variable from its parent’s scope. This is really useful for passing state around your application when the inner function is called after the outer function has exited. Javascript supports functions nested [...]
Published in Javascript, Web development on Friday, October 17th, 2008
The object literal syntax is great for setting up one off objects but sometimes you’ll want to mass produce objects that all have the same properties and methods. It would be a pain to have to set up each object individually so instead you can use a constructor function to do it for you. There’s [...]
Published in Javascript, Web development on Sunday, September 14th, 2008
I downloaded Google Chrome tonight. It’s the pretty! Only scary thing is something Joe noticed… how much the logo looks like GlaDOS from Portal. Remember that time I pretended to murder you?
Published in Browsers on Tuesday, September 2nd, 2008
I’m off to do a user group talk tomorrow night about object oriented javascript. :) Here are all the talk materials including slides, all samples and my list of bullet points I used to remind me what I wanted to talk about for anyone who went to the talk and wanted to take a look [...]
Published in Javascript, My presentations, Web development on Sunday, August 31st, 2008
Anonymous functions are functions that are dynamically declared at runtime that don’t have to be given a name. Anonymous functions are declared using the function operator. You can use the function operator to create a new function wherever it’s valid to put an expression. For example you could declare a new function as a parameter [...]
Published in Javascript on Saturday, August 23rd, 2008
Functions in javascript are first class objects. This means that javascript functions are just a special type of object that can do all the things that regular objects can do. Really, just like any other variable Here are a few of the important objects things that you can do with a function in javascript. A [...]
Published in Javascript on Tuesday, August 19th, 2008
Javascript objects are basically just hash tables, a group of related properties and functions that can be accessed by a key. Properties are dynamically added at runtime. Methods are just properties that happen to be functions. Building a simple object The simplest way to build objects in Javascript is by declaring a new variable of [...]
Published in Javascript on Sunday, August 17th, 2008
This is a series of articles about how to use the javascript language features to write object oriented type code. It's designed for people who are already sold on the idea of bundling functionality up into objects and want to know the javascript way of doing things.
Published in Javascript on Sunday, August 17th, 2008
My favourite new webdev tool of the moment is IETester. You can use it to test pages in IE5.5, IE6, IE7 and IE8 all on the same machine without messing around with your main installed version of IE. I was pretty amazed when I saw it because I’d always believed that it was a bit [...]
Published in Browsers, Tools on Thursday, August 7th, 2008
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.
Published in CSS on Sunday, July 27th, 2008
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 [...]
Published in CSS on Friday, July 18th, 2008