Tag Archives: Fun

Short Ajax Script

April 13, 2008 by aaron

AJAX - it

I wanted to see how small you could make a fully functional AJAX script that worked cross-browser and degraded gracefully, so I went through an old custom AJAX script and made it as small as I possibly could. In the resulting AJAX scripts, the post version is 410 characters and the GET version is only 359 characters long. The scripts are fully functional and accept the following parameters: URL, DATA (in string form), and ELEMENT (to update).

The scripts could be a little smaller, but it would really kill readability.

“Get” AJAX Script

function a(l,d,u){
try{r = new XMLHttpRequest();}catch(e){try {r = new ActiveXObject('Msxml2.XMLHTTP');}catch(e){r = new ActiveXObject('Microsoft.XMLHTTP');}}
if(r){
r.onreadystatechange = function() {if (r.readyState == 4 && r.status == 200){document.getElementById(u).innerHTML = r.responseText;}}
r.open('GET', l+'?'+d, true);r.send(d);
}
}

“Post” AJAX Script

function b(l,d,u){
try{r = new XMLHttpRequest();} catch(e){try {r = new ActiveXObject('Msxml2.XMLHTTP');} catch(e){r = new ActiveXObject('Microsoft.XMLHTTP');}}
if(r){
r.onreadystatechange = function() {if (r.readyState == 4 && r.status == 200){document.getElementById(u).innerHTML=r.responseText;}}
r.open('POST', l, true);r.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');r.send(d);
}
}

Combined AJAX Script

This combined script also accepts a fourth parameter ‘p’ that should evaluate true if the data is to be sent by post.

function a(l,d,u,p){
try{r = new XMLHttpRequest();}catch(e){try {r = new ActiveXObject('Msxml2.XMLHTTP');}catch(e){r = new ActiveXObject('Microsoft.XMLHTTP');}}
if(r){
r.onreadystatechange = function() {if (r.readyState == 4 && r.status == 200){document.getElementById(u).innerHTML = r.responseText;}}
if(p){r.open('POST', l, true);r.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');}else{r.open('GET', l+'?'+d, true);}
}
}

Demo: (Sorry but you will have to go to the full page so the JavaScript is loaded.)

Read More ⟶

Oh I am a gummy bear; yes, I am a gummy bear…

April 29, 2008 by aaron
The best thing to come out of YouTube since the Kiwi: the Gummy bear song. Oder, ich bin ein gummi Bär; ich bin ein gummi Bär. All right, all right. Back to your regularly scheduled broadcasting.

My feeds. You’ve kept me entertained, now I’m returning the favor.

April 17, 2008 by aaron
Ever wondered or cared what I read in the mornings? [RSS] Aardvarchaeology [RSS] Accelerating Future [RSS] Adventures in Ethics and Science [RSS] Aetiology [RSS] Anthology of Ideas Yah, I subscribe to my own feed…but only so I can make sure everything comes out nice… [RSS] Astronomy Buff [RSS] Bad Language [RSS] behindthebuzz.com [RSS] Blog Maverick [RSS] Chris Garrett on New Media [RSS] Cocktail Party Physics [RSS] Cognitive Daily [RSS] Comics at GiantITP.com One of my Favorite Webcomics [RSS] Copyblogger [RSS] Cosmic Variance [RSS] CSS Beauty Gallery Entries [RSS] Deep Sea News [RSS] evolgen [RSS] FOSSwire [RSS] Freelance Switch [RSS] Functioning Form: Interface Design [RSS] Google Tutor [RSS] hicksdesign – journal [RSS] /home/liquidat [RSS] I Can Has Linux?
Read More ⟶

Looking for locksmith; will pay 550 thousand dollars.

April 7, 2008 by aaron
I was going to help this poor man, but “offortunitely,” I don’t have a hammer. Maybe you can? Dear Sir, This is john kamara from Liberia West Africa. I am the only son of my father. My late father was the managing director of gold and diamond company in my country. And he use his position then to make away for me and my only mother. Right now. I am in Ghana and I came dawn with a consignment worth 5.5million dollars.
Read More ⟶

Sobe Life Water Dancing Lizards Super Bowl Commercial

April 4, 2008 by aaron
Sobe Life water is presenting a new website http://www.thrillicious.com/ and is using dancing Lizards to do it. I’m partial to reptiles, so this is one of the best commercials I’ve ever seen. Want to see the commercial? Watch it below or go to the website and click on the Super Bowl Ad link. Some More Pictures of this wonderful commercial:(All images are copyright their owners.)

The future of the English language.

April 27, 2008 by aaron
The following was sent to me by a friend, the original source is unknown, and google wasn’t much of a help. The European Commission has just announced an agreement whereby English will be the official language of the European Union rather than German, which was the other possibility. As part of the negotiations, the British Government conceded that English spelling had some room for improvement and has accepted a 5- year phase-in plan that would become known as ‘Euro-English’.
Read More ⟶

Short Ajax Script

April 13, 2008 by aaron

AJAX - it

I wanted to see how small you could make a fully functional AJAX script that worked cross-browser and degraded gracefully, so I went through an old custom AJAX script and made it as small as I possibly could. In the resulting AJAX scripts, the post version is 410 characters and the GET version is only 359 characters long. The scripts are fully functional and accept the following parameters: URL, DATA (in string form), and ELEMENT (to update).

The scripts could be a little smaller, but it would really kill readability.

“Get” AJAX Script

function a(l,d,u){
try{r = new XMLHttpRequest();}catch(e){try {r = new ActiveXObject('Msxml2.XMLHTTP');}catch(e){r = new ActiveXObject('Microsoft.XMLHTTP');}}
if(r){
r.onreadystatechange = function() {if (r.readyState == 4 && r.status == 200){document.getElementById(u).innerHTML = r.responseText;}}
r.open('GET', l+'?'+d, true);r.send(d);
}
}

“Post” AJAX Script

function b(l,d,u){
try{r = new XMLHttpRequest();} catch(e){try {r = new ActiveXObject('Msxml2.XMLHTTP');} catch(e){r = new ActiveXObject('Microsoft.XMLHTTP');}}
if(r){
r.onreadystatechange = function() {if (r.readyState == 4 && r.status == 200){document.getElementById(u).innerHTML=r.responseText;}}
r.open('POST', l, true);r.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');r.send(d);
}
}

Combined AJAX Script

This combined script also accepts a fourth parameter ‘p’ that should evaluate true if the data is to be sent by post.

function a(l,d,u,p){
try{r = new XMLHttpRequest();}catch(e){try {r = new ActiveXObject('Msxml2.XMLHTTP');}catch(e){r = new ActiveXObject('Microsoft.XMLHTTP');}}
if(r){
r.onreadystatechange = function() {if (r.readyState == 4 && r.status == 200){document.getElementById(u).innerHTML = r.responseText;}}
if(p){r.open('POST', l, true);r.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');}else{r.open('GET', l+'?'+d, true);}
}
}

Demo: (Sorry but you will have to go to the full page so the JavaScript is loaded.)

Read More ⟶

Oh I am a gummy bear; yes, I am a gummy bear…

April 29, 2008 by aaron
The best thing to come out of YouTube since the Kiwi: the Gummy bear song. Oder, ich bin ein gummi Bär; ich bin ein gummi Bär. All right, all right. Back to your regularly scheduled broadcasting.

My feeds. You’ve kept me entertained, now I’m returning the favor.

April 17, 2008 by aaron
Ever wondered or cared what I read in the mornings? [RSS] Aardvarchaeology [RSS] Accelerating Future [RSS] Adventures in Ethics and Science [RSS] Aetiology [RSS] Anthology of Ideas Yah, I subscribe to my own feed…but only so I can make sure everything comes out nice… [RSS] Astronomy Buff [RSS] Bad Language [RSS] behindthebuzz.com [RSS] Blog Maverick [RSS] Chris Garrett on New Media [RSS] Cocktail Party Physics [RSS] Cognitive Daily [RSS] Comics at GiantITP.com One of my Favorite Webcomics [RSS] Copyblogger [RSS] Cosmic Variance [RSS] CSS Beauty Gallery Entries [RSS] Deep Sea News [RSS] evolgen [RSS] FOSSwire [RSS] Freelance Switch [RSS] Functioning Form: Interface Design [RSS] Google Tutor [RSS] hicksdesign – journal [RSS] /home/liquidat [RSS] I Can Has Linux?
Read More ⟶

Looking for locksmith; will pay 550 thousand dollars.

April 7, 2008 by aaron
I was going to help this poor man, but “offortunitely,” I don’t have a hammer. Maybe you can? Dear Sir, This is john kamara from Liberia West Africa. I am the only son of my father. My late father was the managing director of gold and diamond company in my country. And he use his position then to make away for me and my only mother. Right now. I am in Ghana and I came dawn with a consignment worth 5.5million dollars.
Read More ⟶

Sobe Life Water Dancing Lizards Super Bowl Commercial

April 4, 2008 by aaron
Sobe Life water is presenting a new website http://www.thrillicious.com/ and is using dancing Lizards to do it. I’m partial to reptiles, so this is one of the best commercials I’ve ever seen. Want to see the commercial? Watch it below or go to the website and click on the Super Bowl Ad link. Some More Pictures of this wonderful commercial:(All images are copyright their owners.)

The future of the English language.

April 27, 2008 by aaron
The following was sent to me by a friend, the original source is unknown, and google wasn’t much of a help. The European Commission has just announced an agreement whereby English will be the official language of the European Union rather than German, which was the other possibility. As part of the negotiations, the British Government conceded that English spelling had some room for improvement and has accepted a 5- year phase-in plan that would become known as ‘Euro-English’.
Read More ⟶