Author | Message |
---|---|
qma
Posts: 7
|
Posted 12:15 May 27, 2014 |
Hi 2.In our lecture example, we actually use this method in the API: jQuery.ajax( [settings ] ) right? Does [settings] means attribute? $.ajax({ Why we do not write the code like: $.ajax( [ {
|
xytian
Posts: 70
|
Posted 12:58 May 27, 2014 |
The bracket in "jQuery.ajax( url [, settings ] )" means optional. Inside { } is a JavaScript Object. [ ] would mean an array. Last edited by xytian at
13:01 May 27, 2014.
|
cysun
Posts: 2935
|
Posted 13:12 May 27, 2014 |
.ajax() supports two ways to specify the url. The first way is to specify it as the first argument of the function, followed by an optional settings object, i.e. .ajax(url [, settings]); the second way is to specify it as a property of the setting object, i.e. .ajax({ url: "...", ...}). |