I have found, too, that it's much quicker to use innerHTML to swap the
content when processing very large, complex pieces of data.  Here's a
short loadHTMLDoc function I use:

    var loadHTMLDoc = function (url, getVars) {
        if (getVars == undefined) {getVars = {}};
        var req = getXMLHttpRequest();
        req.open("GET", url, true);
        var data = queryString(getVars);
        return sendXMLHttpRequest(req, data);
    }

    var swapInnerHTML = function (target, template, params) {
        var req = loadHTMLDoc(template, params);
        req.addCallback(function(doc){
            $(target).innerHTML = doc.responseText;
        });
        req.addErrback(function(error){
            alert('Problem swapping html from '+ template + ' to ' +
target);
        });
        return false;

--T

Reply via email to