Web development

The Mozilla equivalent of CurrentStyle on 01 Sep 05 (Add comment)

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. […]

JSLint: neat javascript script verifier tool on 15 Aug 05 (Add comment)

I found a useful little utility called Lint that checks for things in your javascript code that’s likely to introduce errors. I really like that it checks for undeclared variables because I always, always, always want to declare my variables before I use them. Considering that forgetting to declare the variable sets it global for […]

Measuring element dimensions and placement in javascript on 11 Aug 05 (2 comments)

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.

Request for comment on the CSS 3 spec on 21 Jul 05 (Add comment)

I saw an article on WASP today asking for comment from web developers on the CSS 3 standard that they’re currently working on. It’s kind of hard to tell how it’s going to be without trying to make a webpage with it, but the idea of being able to use multiple background images in the […]

Back referencing in javascript regular expressions on (1 comment)

I’ve used regular expressions to do find and replace Javascript before, but I’ve never managed to do the thing where you can take part of the string that has been matched and use it in the replace string. It turns out the piece of the puzzle I needed to find was something called back references. […]

Image to icon service online on 15 Jul 05 (Add comment)

I just saw a link to a nice site that will convert an image from various common formats into an icon. This is very nice if you don’t have access to a proper icon editor.

Has google become sentient? on 05 Apr 05 (5 comments)

Scary thing that just happened to me.. I was looking at my logs and noticed someone had been to my portfolio site by searching on my full name. I put it into google because I was surprised it was near the top on such a general search (because there are heaps of other people with […]

Handling SelectedIndexChange for a DropDownList in a Repeater on 25 Jan 05 (5 comments)

Came across an interesting problem yesterday trying to handle the SelectedIndexChanged event for a DropDownList that was inside a Repeater. I found a wonderful article on Databinding that gave me most the information I needed, but their method of handling events just didn’t work for me. My first problem was that I originally did the […]

Macromedia Flex on 11 Jan 05 (Add comment)

Just read an interesting article about a new Macromedia tool called Flex. It seems to be somewhere between a flash application and a classic web app. The really cool thing about it is that it runs on top of existing platforms like .NET and J2EE and can be developed in eclipse or visual studio. Developers […]

Social networks on 15 Dec 04 (Add comment)

Interesting article by Dare Obasanjo about Social software. I think the lock-in he’s talking about creating is something that benefits companies rather than users. Is having your blog, photo-sharing, IM and email all through the same company actually a benefit if it means in a few years time you can’t try something new because you […]

XMLHttpRequest and Google suggest on 13 Dec 04 (Add comment)

Wow! I didn’t even know about the XMLHttpRequest object that powers Google suggest. This is the first thing I’ve seen in *ages* that seriously changes how we can make webpages. :) I’m so glad that the web is still an exciting place to hang out.

Disabling animated gifs in firefox on 08 Dec 04 (Add comment)

Animated gifs drive me absolutely crazy. To turn them off in firefox: 1. Type “about:config” in the location bar 2. Find the “image.animation_mode” parameter and change it to “once” or “none” Have I mentioned how much I love firefox? Power to the people! The geeks shall inherit the earth. Reference: Post in the UserFriendly forums

HTML doctypes on 07 Dec 04 (Add comment)

I can never remember these things. This is a list so I (or you) can just cut and paste into pages. HTML 4 transitional: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd"> HTML 4 strict: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd"> XHTML transitional: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> XHTML strict: <!DOCTYPE html PUBLIC "-//W3C//DTD […]

The net's an amazing place :) on (Add comment)

See two of my favourite technologies combined: Amazon.com and MSN messenger! I don’t know if it’s useful, but it sure is cool! Another interesting find for today was googleblog.

Creating tags with non-literal data in XSLT on 03 Dec 04 (Add comment)

If you’re forced to work with a schema where the tag names contain derived data (node position in this case) you can create your tag names in XSL using the element tag: <xsl:element name="{concat(‘mytagname’, position( ))}"> <xsl:value-of select="mytag"/></xsl:element>

Finding position of the parent node in XSLT on (1 comment)

Here’s a really nifty solution to the problem of finding the position of a node’s parent node from the comp.text.xml newsgroup. The idea is you can find the position of the parent node by you counting all its preceding siblings. <xsl :value-of   select="count(parent::bar/preceding-sibling::bar) + 1"/>

Automatically initialising Javascript objects that require the DOM on 23 Nov 04 (Add comment)

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 […]

Keep it simple on (Add comment)

Adam Bosworth talks about how the value’s in the content not the technology.

A DOM friendly way of getting values from radio buttons on 17 Nov 04 (Add comment)

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 […]

Jumping to anchors in table cells on 26 Oct 04 (Add comment)

Interesting IE observation: You can’t jump to anchors in otherwise empty table cells. This works: <tr>     <td>&nbsp;<a name="myanchor"></a></td> </tr> This doesn’t: <tr>     <td><a name="myanchor"></a></td> </tr> I know I’m doing terrible things to my markup to even want to put an anchor in an empty table cell.. :) Other people seem to […]

DOM-created radio buttons don't work in IE6 on 23 Oct 04 (Add comment)

*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, […]

PNG Alpha transparency code in IE on 19 Oct 04 (Add comment)

Because of incompatibilities between IE and the world, to get PNG transparency to work in IE you need to add this to your stylesheet: img.transparent { filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=’myimage.png’,sizingMethod=’scale’);} There’s more information at A List Apart and WebFX

The problems with playing the system on 09 Oct 04 (Add comment)

I’ve been thinking a fair bit about search engine optimisation lately since I started looking at url rewriting for one of our customers at work. Before I start my rant I’d like to say I’m not talking about the type of search engine optimisation that makes the quality content of your site more meaningful for […]

Accessing current style attributes on 07 Oct 04 (Add comment)

Had a problem this morning trying to access the display property of html form elements that were hidden because one of their parent elements had the style.display property set to “none”. <tr style=”display:none”> <td><input name=”foo”/></td></tr> My script worked fine when I called document.getElementById(“moo”).style.display on the elements whose display property I had set to “none”, but […]

Setting up custom 404 pages on apache on 20 Sep 04 (Add comment)

Enabling htaccess on apache: 1. Open httpd.conf (in <apache_dir>/conf directory) 2. Find the <directory> for the directory you want to change it in 3. Change AllowOverride None