Predicting an Eventual Return

So, it has been quite a while since I posted on my own website. In the past 2 years, there have been what 2 posts? I’ve barely even looked at it just dropping in long enough to clear out some spam comments or deal with someone who thinks this is the perfect platform to be hateful on. Where have I been? Well, I’m in the process of moving all of my WordPress Plugins and content over to my business website at AaHa Creative and I’ve started a web development blog there.

I’m moving all my business and work related content there and will be actually taking posts down off this site and reposting things there. I’ve also made new pages for and updated many of my wordpress plugins there.

From now on, business and programming related content will go there, and when I am ready to start posting on literature, history, philosophy and related topics again, the new content will be posted here.

I’ve had to let a few of my personal projects like AJAXed WordPress fall to the wayside as I had too many other things dividing my time into itsy-bitsy little fragments.

Things are slowing down now and the craziness of the past year or two has begun to ebb, so eventually, I’m going to start posting here again, but for now, if you read the website for WordPress related stuff, head over to my business website. And heck, if you need some web development done too, I’m pretty sure you won’t have a hard time finding a nice contact form. ;)

I’m alive but still not talking to you.

There have been no posts for a while now and none of the updates to AJAXed WordPress or my other plugins have been pushed out. There is a lot of stuff (of the good kind) that is going on in my life currently, so I’ve put everything else on the back burner.

Thank you for your understanding.

P.S. Don’t you hate posts like this? Me too!

Short Ajax Script

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.) Continue reading »