Hey,

conspireagainst a écrit :
> Is there any possible way (I'm using prototype framework) to glean
> what the name of the container element to be updated (using
> Ajax.Updater) is?

Of course there is.

> I have appended at the bottom of prototype.js a function that shows a

OK, don't do that, please.  You're asking for trouble: whenever we 
release a new prototype.js file, you'll have to patch it.  Create your 
own .js file and load it after prototype.js, instead.  Don't hack the 
lib, that's not in your mid- or long-term interest.

As the docs state [1], Ajax.Responders callbacks are invoked with the 
request object (either Ajax.Request or Ajax.Updater) as the first argument.

In the case of Ajax.Updater, the container it's going to update is 
referenced with the updater's container.success property.

So you could do something like this (and btw, be clear: you're not 
looking for names, but for id's):

Ajax.Responders.register({
   _skippedIds: /^(?:id1|id2|id3...)$/,
   onCreate: function(req) {
     var container = req.container;
     if (!container || !this._skippedIds.test(container.success.id))
       return;
     // Your code here.
   }
});

'HTH

-- 
Christophe Porteneuve aka TDD
[EMAIL PROTECTED]

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" 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/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to