All pastes #241105 Raw Edit

xorc

public javascript v1 · immutable
·published 2006-11-06 00:39 UTC
rendered paste body
<script type="text/javascript">function ajax_call (url) {        // httpRequest var should be assigned to the xmlhttprequest object    var httpRequest = new XMLHttpRequest();        // But if it doesnt succeed, set it too the activexobject for internet explorer    if (!httpRequest) httpRequest = new ActiveXObject("Microsoft.XMLHTTP");    // And if everything fails, return false.    else if (!httpRequest) {        return false;    }    // We're not doing xml, no sir!    httpRequest.overrideMimeType('text/plain');    // Request handler.    httpRequest.onreadystatechange = function () {        // Switchboard for ajax - states        switch (httpRequest.readyState) {                        // loading            case 1:            case 2:                // Do something                        break;            // interactive, interessting            case 3:                // TODO::FINDOUT                break;                        // Ready state.            case 4:                    // Successful!                    return true;                break;        }    }        // Request the url given in the paramters    httpRequest.open('GET', url, true);    // TODO::WHATS THIS?    httpRequest.send(null);            // Well, it didnt go too well    return false;}