Friday, May 10, 2024
 Popular · Latest · Hot · Upcoming
40
rated 0 times [  45] [ 5]  / answers: 1 / hits: 18947  / 13 Years ago, wed, july 27, 2011, 12:00:00

How can I modify the default values of options for the $.ajax() function?



Ideally to do something similar to:



//set ajax async to false
$(someSelector).load(url, data, function(){});
//set ajax async to true


to allow me to carry out .post() synchronously.


More From » jquery

 Answers
40

You want ajaxSetup



 $.ajaxSetup({
url: /xmlhttp/,
global: false,
type: POST

});
$.ajax({ data: myData });

[#90964] Tuesday, July 26, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
kaitlynnb

Total Points: 402
Total Questions: 96
Total Answers: 109

Location: Trinidad and Tobago
Member since Fri, May 8, 2020
4 Years ago
kaitlynnb questions
;