« March 2006 | Main | May 2006 »
April 28, 2006
CSS Reboot
Just realised I'm going to miss the deadline for the May 1st CSS Reboot - again!
.. or will I?
update (08-05-06): yes, I will...
Posted by dottie at 4:06 PM | Comments (0)
April 26, 2006
Got some Hash? Javascript associative arrays
First, the quick and dirty - creating an associative array in one fell swoop:
webstersCorrect = {
”color” : "colour",
“normalcy” : "normality",
"aloominum" : "aluminium",
"George W Bush" : "cocaine addict"
};
or even multi-dimensionally
Queen = {
”roger” : [”drums”,”blonde″],
“john” : [”bass”,”brown″],
“brian” : [”guitar, uke”,”black″],
“fred” : [”vox”,”black″]
}
Accessing elements of these is easy:
webstersCorrect["color"] = "Colour"
Queen["fred"] = ["vox","black"]
or even
Queen["brian"][0] = "guitar"
Programatically this is simplicty itself also:
var Result = "";
for ( Bit in webstersCorrect ) {
Result += Bit + " = " + webstersCorrect + "\n";
}
document.write( Result ); // yeuch!
would result in a list like this:
color = Colour
normalcy = normality
aloominum = aluminium
George W Bush = cocaine addict
you can also use nested loops
for ( Bit in Queen ) {
for ( Thing in Queen[Bit] ) {
Result += Queen[Bit][Thing];
... and whatever else...
}
}
Not very inspired but you get the idea...
They are great for ASP creating a HASH from the result of your SQL statement so that you can open your Recordset, fill your hash and then close the recordset. I have a load of modules built to help me do all these things so coding in ASP is nice a quick for me now, not to mention clean codewise as all the functions are in separate files off the page.
Of course ASP>NET does all that for you but we all know how much of a bloated pig that is...
Posted by dottie at 11:14 PM | Comments (0)
April 25, 2006
Schadenfreude
It was bound to happen. I hate to say I told you so (actually. I don't)
Shock! - IE7 likely to break a raft of CSS hacks
Now to go and install the Beta, fix the CSS errors I have and maintain a smug superiority :)
Posted by dottie at 11:01 AM | Comments (0)
Tech books online
Fantastic! Altruism is alive and well
Online books / tutorials / instant karma
Posted by dottie at 10:57 AM | Comments (0)