Ruby Forum Rails Spinoffs > Ajax.Updater without parsing html

Posted by michal (Guest)
on 13.05.2008 13:20
(Received via mailing list)
hey,
i was wondering if its possible to use an Ajax.Updater which load a
given page into a container .. but instead of parsing the html i would
like to see the actual source code ... i could not find anything in
prototype.
thanks for advice!
Posted by SWilk (Guest)
on 13.05.2008 14:41
(Received via mailing list)
Hey,

michal wrote:
> hey,
> i was wondering if its possible to use an Ajax.Updater which load a
> given page into a container .. but instead of parsing the html i would
> like to see the actual source code ... i could not find anything in
> prototype.


I think you should use Ajax.Request, .escapeHtml the response in
onComplete/onSuccess and then .update the placeholder:


new Ajax.Request(url, {
    onSuccess: function(transport) {
  $(placeholder).update(transport.responseText.escapeHTML());
    }
});

Regards,
Szymon
Posted by Michal Gabrukiewicz (Guest)
on 13.05.2008 15:16
(Received via mailing list)
thanks! this works great