Tagged with dom

Bookmark: Mozilla DOM documentation

I’ve finally found some Mozilla javascript docs that as good as the IE ones. One of the really nice thing about the Mozilla docs is they have lots of details about the versions that things work in and warnings about potential problems that you might have when using some of the features. For example I [...]
Published in Web development on Wednesday, April 19th, 2006

Measuring element dimensions and placement in javascript

I found a really useful page on the MSN site that explains how measuring element dimensions and locations work in javascript. There’s a great image that shows you how to measure any of the different areas using the different javsacript width, height and placement properties.
Published in Javascript on Thursday, August 11th, 2005

Automatically initialising Javascript objects that require the DOM

One of the problems I had when I first started creating Javascript widget objects is that I always needed to create the object in two stages. First I’d actually create an object with the correct parameters, then I’d register a piece of script that actually did all of the initialisation code that accessed the DOM [...]
Published in Javascript on Tuesday, November 23rd, 2004

A DOM friendly way of getting values from radio buttons

The problem with radio buttons is they don’t work like ordinary form elements. You can’t just apply an ID to a radio group, use document.getElementById() to get a reference to it and then query the value. This means to find the value of my radio group I’ve had to use the old fashioned document.forms[0].groupName method [...]
Published in Javascript on Wednesday, November 17th, 2004

DOM-created radio buttons don't work in IE6

*sigh* This is a nasty little known problem with IE when creating radio buttons using document.createElement(). IE actually creates the buttons, but they can’t actually be selected by the user. The problem is that aparently IE doesn’t let you set the name attributes of elements after they’ve been created. If you update the name attribute, [...]
Published in Browser quirks on Saturday, October 23rd, 2004