It's close, but not quite what I meant. I'd like to be able to access
the response after the request has already been made, preferably
outside of the Request object. It's for an RSS reader, so I need to do
some parsing and Request is just being used to get the feed from a
server file. This function is a method in a class, which should return
the response in a string, but it isn't returning anything but
undefined:
fetch: function(site){
var feed;
var req = new Request({
method: this.options.method,
url: this.options.rssFetchPath,
data: { 'url' : site },
onRequest: function() {
if (this.options.targetId) { $
(this.options.targetId).setProperty('html',
this.options.onRequestMessage); }
}.bind(this),
onSuccess: function(responseText) {
feed = responseText;
}
});
req.send();
return feed;
}
On Sep 18, 1:21 pm, "Iván N Paz" <
ivann...@gmail.com> wrote:
> Taking this code as an example:
>
> new Request.HTML(
> {
> url:'some/url/script.php',
> evalScripts:true,
> async:false,
> autoCancel:true,
>
> onSuccess: function(html) {
> //html processing here....
> alert(html);
> },
>
> onFailure: function() {
> alert('Error');
> }
> }
> ).get();
>
> I would just take the html node listing, process it in whatever way I
> want, then inject it....
>
> Is that what you meant???
>