Posted: July 15th, 2009

fun proof

Category: technical

when i used to work at sperka int’l a while back i wrote a block of javascript for one of our clients, discounttirecenters.com

here are my shenanigans.

it was simple old style ajax image fetcher.
shows how much i love the matrix i guess.

function getimage (matrix, neo, zion, anderson) {
       
        var nebuchadnezzar = document.getElementById(matrix)
        var entermatrix = matrix
        if(window.XMLHttpRequest)
        req = new XMLHttpRequest();
                else if (window.ActiveXObject)
                        req  = new ActiveXObject(‘Microsoft.XMLHTTP’);
                req.onreadystatechange = function()
                { if(req.readyState == 4)
                        { if(req.status == 200){
                                        the_redpill = req.responseText;
                                        nebuchadnezzar.style.display = ‘block’;
                                        if (the_redpill == ) {
                                        nebuchadnezzar.innerHTML = ‘<div><a href="product_detail.php?c=’+anderson+‘&prodID=’+neo+‘"><img src="images/images_products/’+ zion+‘/normal/notire.png" width="150" /></a><br />click for more details<br />’;
                                        } else {
                                        nebuchadnezzar.innerHTML = ‘<div><a href="product_detail.php?c=’+anderson+‘&prodID=’+neo+‘"><img src="images/images_products/’+ zion+‘/normal/’+the_redpill+‘" width="150" /></a><br />click for more details<br />’;
                                        }
                               
                                       
                                }else {
                                        document.getElementById(‘errors’).innerHTML="Error: returned status <br />code " + req.status + " " + req.statusText;
                                }
                        }
                };
                req.open("GET", "option_populater.php?imagecheck=" + neo + "&whichDB=" + zion, true);
                req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
                req.send(null);
}