Wed
28
Jun

Behavioral Separation

Posted by

I’ve just finished reading a nice little article that I thought I’d share with you all. I’m sure quite a few of you read A List Apart, the developers’ site started by Jeffrey Zeldman and friends. For me it was a godsend of interesting and innovative ideas that spurred me on in my Uni days last century.

I’ve sort of drifted away from it over the last few years, like an old friend you lose touch with only to see infrequently in random places where you promise to keep in touch. Quite often you find out new and interesting news though, and this little foray back to A List Apart is one of those.

The article talks about separating not just style from mark-up but also separating your client side scripting from your mark-up. For some of you this may be a bit hardcore and techy, but I’m sure that many of you will find this very useful. Rather than littering your code with JavaScript in your links etc you can use ID’s to target elements with your script by using .getElementById.

Now, I don’t claim to understand it fully (JavaScript and me have a mutual misunderstanding), but I do know that keeping your code slim and separating the scripting is a good idea. DOM scripting is cool I just wish I could do it! ;)

Read the article and see what you think.

Jeremy Keith’s Behavioral Separation

comments

Comments

Post it

Cole Henley
28 June 2006

Stef, check out the book ‘DOM Scripting: Web Design with JavaScript and the Document Object Model’ for a very accessible intro to DOM scripting – even my chronic javascript-slexia was able to cope with it!