#1030 new
T.J. Crowder

Add 'context' parameter to ajax options

Reported by T.J. Crowder | April 11th, 2010 @ 09:57 AM

I know there's a major revision of the ajax stuff coming, Tobie's mentioned it a couple of times, and I expect this will probably be covered by that -- but just in case/for tracking purposes:

Let's add a context parameter to the ajax options which, when supplied, is used when calling the callbacks. This eliminates the need for generating functions on-the-fly (e.g., via Function#bind) for a common use-case (callback to a function where we want to specify the context).

I added this to a wrapper I use in some of my apps that does several app-specific things a few months back, and I've been struck by how this aspect improves usability.

I'd be happy to create a patch to 1.7's Ajax classes if the core team would like me to, either to slip into 1.7 (although now that an RC is out, I figure you're not adding new features -- it's small in both impact and code, though) or just as a starting point. But with the redesign imminent, I wondered if it would be wasted effort. (I hadn't realized 1.7 was going to come out without the redesign, or I'd've tried to contribute it to that earlier.)

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The Prototype JavaScript library.

Shared Ticket Bins

People watching this ticket