SHOW:
|
|
- or go back to the newest paste.
1 | this.FuncName = function (variable) { | |
2 | $.ajax( | |
3 | { | |
4 | type: "POST", | |
5 | url: '/.../...', | |
6 | data: function(variable) { | |
7 | if (variable) { | |
8 | JSON.stringify({ field1: value1, field2: value2 }), | |
9 | } else { | |
10 | JSON.stringify({ field1: value3, field2: value4 }), | |
11 | } | |
12 | }, | |
13 | ... | |
14 | } |