Ajax安装问题

I have 2 questions.

  1. Is it bad to have multiple AjaxSetups? Say I have 2 pages. One page need 5 options set and the other page needs 7(5 of them are the same as the first page). Could I just have 2 ajax setups instead of one? so I am not repeating the same options.

  2. If you have an ajax setup option set and the same option set at the ajax request level($.ajax) which one would it take? Would it take the one set on the ajax request or the global one on the ajaxSetup?

Thanks

Nothing in the jQuery doc speak about your first question so I make a little test in http://jsfiddle.net/x6agm/1/ and according to the behavior:

  1. It's not bad, you can safely make two different $.ajaxSetup calls and the properties modified in the first call, but not in the second call, will have the values imposed in the first call.
  2. The specified properties of an $.ajax object always overwrite the properties of $.ajaxSetup.

Sorry for my bad english, check the test for a better understand ^_^