On Fri, Oct 23, 2009 at 9:14 PM, gMinuses <[email protected]> wrote:
> [ ... ]
> But doe it mean I have to write code like this to make an ajax:
> // [ ...]
> $.ajax({
> url: './index.html',
> data: $.ajaxSetup.ext({
> customKey: "customValue"
> }
> })
Yes, I'm afraid it does. In any solution that manages your original
goals without in some way changing jQuery, you will need to find a way
to combine your common parameters with the ones specific to the call.
This is a fairly elegant way to achieve that. You could of course
make a change to jQuery's ajax method, but I wouldn't suggest it.
One thing, though. There is a typo in the above:
> data: $.ajaxSetup.ext({customKey: "customValue"}
should be
> data: $.ajaxSettings.ext({customKey: "customValue"})
(You missed the closing parenthesis and used "ajaxSetup" instead of
"ajaxSettings.)
Cheers,
-- Scott
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery Development" 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/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---