Welcome to TehDevs.net, where Andy and I hope to impart some nerd wisdom to the masses. And also to spare our regular blog readers from pages of code.
For this first post, I’m going to outline some work I’ve been doing on the next E29 product, using XML namespaces.
XML namespaces are a great way to define your own custom attributes for HTML elements, and still pass the page through a validator.
The possibilities for the namespaces are endless, and of course some are more cumbersome than they’re worth, but for a simple example, I will explain how to use namespaces to define options for a javascript routine, but without using a Javascript block in the body.
The first thing you need to define is the namespace itself in the html element of your page:
FYI: Your page needs to have the DTD tag of XHTML 1.0 for these namespaces.
We define the namespace using the xmlns:fader bit. A word of caution, you can only use one custom namespace per page.
Next I’ll define some Javascript in the head element to handle the custom elements and mouseovers.
The Javascript bit handles pulling the actual custom element. The getNamedItem() call is compatible with both IE6 and Firefox, so you can code it and leave it.
Now, the final touches, applying the custom attribute.
The onmouseover() attribute could be defined in a better way, but this works for now.
Now when you mouse over each div, the handler fires, reads the custom doFade attribute, and follows the proper logic.
That’s all for the first post, I’ll expand on this topic more later.

Subscribe to TehDevs!
[…] month, lots of design tweaks, and an entry about XML namespaces later, TehDevs.net is […]
TehDevs.net goes live! on 09.04.07I’m thrilled that this is up. hopefully the things posted won’t be too high over my head
grats adam
rottenpossum on 09.05.07