| 1 |
sgRequestHandler.prototype.prepareData = function() { |
| 2 |
this.url = getAjaxUrl(); |
| 3 |
|
| 4 |
if(typeof this.data === 'undefined') { |
| 5 |
if (this.dataIsObject === true) this.data = {}; |
| 6 |
else this.data = ''; |
| 7 |
} |
| 8 |
|
| 9 |
var action = 'backup_guard_'+this.action; |
| 10 |
if (this.dataIsObject === true) { |
| 11 |
//if formdata |
| 12 |
if(this.data instanceof FormData){ |
| 13 |
this.data.append('action', action); |
| 14 |
} |
| 15 |
else { |
| 16 |
this.data['action'] = action; |
| 17 |
} |
| 18 |
} |
| 19 |
else { |
| 20 |
if (this.data !== '') this.data += '&'; |
| 21 |
this.data += 'action='+action; |
| 22 |
} |
| 23 |
} |
| 24 |
|