Like I said: setting data property in ajaxSetup won't work, if it's
specified
in individual ajax calls.

But Dave Methvin said that $.ajax adds a "X-Requested-With:
XMLHttpRequest" header. I think the whole idea of appending some
parameters becomes obsolete. Anyway, thanks for the reply.

On Oct 1, 6:36 am, Andrea Giammarchi <andrea.giammar...@gmail.com>
wrote:
> or ...
>
> jQuery.ajaxSetup({
>     data:{
>         defaultKey:"defaultValue",
>         otherKey:"otherValue"
>     }
>
> });
>
> ...
>
> On Wed, Sep 30, 2009 at 11:34 PM, Andrea Giammarchi <
>
> andrea.giammar...@gmail.com> wrote:
> > Heve you tried already:
>
> > jQuery.ajaxSettings.data = {
> >     defaultKey:"defaultValue",
> >     otherKey:"otherValue"
> > };
>
> > ???
>
> > On Tue, Sep 22, 2009 at 9:18 AM, gMinuses <gminu...@gmail.com> wrote:
>
> >> Is there a way to automatically append some parameters in every ajax
> >> call's query string?
>
> >> "ajaxStart" event doesn't send ajax options to callback function, so
> >> there is not way to modify the query string.
>
> >> "ajaxSend" event doesn't work with GET request, because the query
> >> string is already appended to the url and xhr is already open, so
> >> there is no way to change the url.
>
> >> For "beforeSend", it's the same as "ajaxSend".
>
> >> Set global setting in ajaxSetup will not work, if "data" is specified
> >> in individual ajax calls.
>
> >> I'd like to add parameters like 'mode=ajax' to make server respond as
> >> little data as posible(e.g, no header, no footer), and degrade
> >> gracefully.
>
> >> I have many ajax calls to make, and adding these parameters to every
> >> single of them manually is very tedious.
>
> >> So how can I achieve this in jQuery?
>
> >> Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-dev@googlegroups.com
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to