My JavaScript book is out! Don't miss the opportunity to upgrade your beginner or average dev skills.

Tuesday, March 13, 2007

Unobtrusive Blog Entry Date

I really like this Brainstorms Raves blog CSS based entry date tutorial but I like unobtrusive content and graceful enanchemet too :)

That's why I created a simple example page to show You how to create a better unobtrusive example, using less tags on page and a bit of JavaScript for compatible browsers (I suppose every recent browser should support that code).

You could view directly CSS or JavaScript source code, do You like it?


Matteo Balocco said...

Andrea, perhaps I missed some your posts about that... but, I'm curious about the way you encapsulate functions in the FOR cycle. Can you please explain your choice and the related reasons? Thank you

Andrea Giammarchi said...

Matteo there's any particular reason to encapsulate one or more function in for loop declaration or inside the function itself.

function createDateTime(){
function p(){...};
function className(){...};
for(var span = ...){};

I used directly variables type instead of functions but speed and quality is quite the same.

Finally You could declare any type of variable inside a for loop, You just need to remember var and coma after each temporary scope vriable (and this is the same for future let declaration).

Andrea Giammarchi said...

Ok Matteo, I've just add new post about your question :)

Anonymous said...

emm.. cognitively style :)