In languages like C# and Java you never really need to give a thought to the
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.
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 […]
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 […]
Anonymous functions are functions that are dynamically declared at runtime. They’re called anonymous functions because they aren’t given a name in the same way as normal functions.
I found a very interesting article about ASP.NET data binding that talks about exactly what’s happening when you call the DataBind() method on a templated control like the repeater. It’s got some really interesting stuff on how the templates are instantiated and how the child controls are built.
I don’t know if this will be useful to anyone else but I thought this was kind of a neat trick for messing around with ASP.NET page rendering for debugging purposes. My problem was I wanted to stop the rendering of a page at a certain point so I could see how the scripts were […]
I ran into a weird problem with dynamically created ASP.NET 2.0 user controls yesterday. I was using the user control to populate a panel of a tab control which meant I didn’t actually have a reference to the user control object anywhere on my form. The only way I could get a reference to it […]
IE has a pretty nice DOM property called currentStyle that you can use to find out the resolved style properties of a DOM object. This is neccessary because the style property will only tell you what style properties have been set, they won’t tell you what properties have been inherited from the element’s parent nodes. […]