Color Drops in Javascript Land!

Add Some color to your life: My first foray into dynamic javascript territory from around 2001!

I put a first post online in 2006, by that time it was already untouched and
a couple of years old. I guess that counts as really OLD! Coming from
computer graphics land I was frustrated with C++, X11 and OpenGL and interested
in playing with dynamic javascript for full-screen, better say full window,
display. The stuff above is an embedded IFrame, you can link to the
originalfull page here.

I can’t exactly say, as the machines and the site no longer exist, but I would
date my little javascript experiment to 2001. Around that time I realized
Javascript was one of the most misunderstood languages and fell in love with
it. Which is for why I tried really really hard writing clean code, something
basically unheard in javascript land, a time of <marquee> tags and javascript
clocks. Flash ruled, and I hated Flash.

Actually, I’m quite proude of my javascript. It’s not complicated, but it is
clean and the amazing part is, it is running untouched, 15 years
later in my browser. Full source code is now merged into this jekyll blog and
can be found on github. Catch a glimpse below, isn’t it beautiful?

functionObjectByName(name){if(document.getElementById){this.obj=document.getElementById(name);this.style=document.getElementById(name).style;}elseif(document.all){this.obj=document.all[name];this.style=document.all[name].style;}elseif(document.layers){this.obj=document.layers[name];this.style=document.layers[name];}}functionwritit(id,text){if(document.getElementById){x=document.getElementById(id);x.innerHTML='';x.innerHTML=text;}elseif(document.all){x=document.all[id];x.innerHTML=text;}}functionappendIt(id,text){if(document.getElementById){x=document.getElementById(id);vartmp=x.innerHTML+text;x.innerHTML='';x.innerHTML=tmp;}elseif(document.all){x=document.all[id];x.innerHTML+=text;}}functionurldecode(){// return a result array even when its emtpyvardata=newArray();do{vars=window.location.search;if(s==null||s==""){break;// emtpy search }if(s.charAt(0)!='?'){alert(" search with no question mark? somethings seriously wrong here");break;}s=s.substring(1);// strip the leading ?varparts=s.split("&");for(pinparts){varpart=parts[p];//alert( p + '->' + part);varx=part.split("=");varname=dehex(x[0].replace(/\+/g," "));varvalue=true;if(1<x.length&&x[1]){value=dehex(x[1].replace(/\+/g," "));}data[name]=value;}}while(false);// return result, can be empty but not nullreturndata;}functionurlparam(key,default_value){varkv=urldecode();varvalue=(kv[key])?kv[key]:default_value;returnvalue;}