Otis, that should read as follows. The xmlProcessor business was for a page
I had that actually did get XML return, but you won't have that, I think.
Truly, this is all there is to AJAX!

var req = null
var isMSIE = false

function loadXmlData(url, data) {
    try {
        if (window.XMLHttpRequest) { // native XMLHttpRequest object
            req = new XMLHttpRequest();
        } else { // IE/Windows ActiveX version
            isMSIE = true
            req = new ActiveXObject("Microsoft.XMLHTTP");
        }
        req.onreadystatechange = processStateChange;
        req.open("POST", url + "?" + data, true);
        req.setRequestHeader('Content-Type',
'application/x-www-form-urlencoded; charset=UTF-8');
        req.send(data);
    } catch (e) {
        alert(e);
    }
}


function processStateChange() {
    if (req.readyState != 4)
        return
    if (req.status != 200) {
        alert(req.statusText);
        return
    }
   [do something with req.responseText]
}





> --
> Robert M. Hanson
> Professor of Chemistry
> St. Olaf College
> 1520 St. Olaf Ave.
> Northfield, MN 55057
> http://www.stolaf.edu/people/hansonr
> phone: 507-786-3107
>
>
> If nature does not answer first what we want,
> it is better to take what answer we get.
>
> -- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
>



-- 
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107


If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to