On May 1, 2006, at 5:17 AM, Uwe Voelker wrote:

>
> Hello,
>
> I'm currently using Prototype (mainly for Ajax things) and I would  
> like
> to give MochiKit a try.
>
> My question: Is there an equivalent for Ajax.Updater?
>
> (Ajax.Updater let's you specify an ID, URL and request data and it
> updates the div with id ID with the HTML from the response.)

Not in the release version, but here's how you'd write it:

updateElementFromHTML = function (id, url) {
        var d = doSimpleXMLHttpRequest(url);
        d.addCallback(function (req) {
                getElement(id).innerHTML = req.responseText;
        });
        d.addErrback(logError);
        return d;
};

-bob


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MochiKit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/mochikit
-~----------~----~----~----~------~----~------~--~---

Reply via email to