mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-03 13:25:05 +01:00
Use a javascript object instead of building a JSON string
This commit is contained in:
parent
0e234a718f
commit
9d4c60bc42
@ -55,26 +55,18 @@ egw_json_request.prototype.sendRequest = function(_async, _callback, _sender)
|
||||
if (typeof _async != "undefined")
|
||||
is_async = _async;
|
||||
|
||||
//Assemble the actual request string
|
||||
var request = '{';
|
||||
request += '"request":{';
|
||||
if (this.parameters)
|
||||
//Assemble the actual request object
|
||||
var request_obj = new Object();
|
||||
request_obj.json_data = new Object();
|
||||
request_obj.json_data.request = new Object();
|
||||
if(this.parameters)
|
||||
{
|
||||
request += '"parameters":[';
|
||||
request_obj.json_data.request.parameters = new Array();
|
||||
for (var i = 0; i < this.parameters.length; i++)
|
||||
{
|
||||
if (i > 0)
|
||||
{
|
||||
request += ',';
|
||||
request_obj.json_data.request.parameters.push(this.parameters[i]);
|
||||
}
|
||||
request += '"' + this.parameters[i] + '"';
|
||||
}
|
||||
request += ']';
|
||||
}
|
||||
request += '}}';
|
||||
|
||||
var request_obj = new Object();
|
||||
request_obj.json_data = request;
|
||||
|
||||
//Send the request via the jquery AJAX interface to the server
|
||||
$.ajax({url: this.url + '?menuaction=' + this.menuaction,
|
||||
|
Loading…
Reference in New Issue
Block a user