Skip to content

Should accepts be set using $.ajaxSetup()? #378

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Peeja opened this issue Oct 28, 2013 · 5 comments
Closed

Should accepts be set using $.ajaxSetup()? #378

Peeja opened this issue Oct 28, 2013 · 5 comments

Comments

@Peeja
Copy link

Peeja commented Oct 28, 2013

The documentation seems conflicted. $.ajax() says:

If the accepts setting needs modification, it is recommended to do so once in the $.ajaxSetup() method.

while $.ajaxSetup() says:

Note: The settings specified here will affect all calls to $.ajax or AJAX-based derivatives such as $.get(). This can cause undesirable behavior since other callers (for example, plugins) may be expecting the normal default settings. For that reason we strongly recommend against using this API. Instead, set the options explicitly in the call or define a simple plugin to do so.

@kswedberg
Copy link
Member

@jaubourg: Can you help resolve this apparent conflict? Which is correct?

@jaubourg
Copy link
Member

jaubourg commented Nov 4, 2013

The second approach is better. This option should be set locally, not globally.

@kswedberg
Copy link
Member

Great. Thanks, Julian!

@kswedberg
Copy link
Member

Thanks for the report, @Peeja. Closed via 26b0689

@Peeja
Copy link
Author

Peeja commented Nov 12, 2013

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants