mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-11 17:20:53 +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")
|
if (typeof _async != "undefined")
|
||||||
is_async = _async;
|
is_async = _async;
|
||||||
|
|
||||||
//Assemble the actual request string
|
//Assemble the actual request object
|
||||||
var request = '{';
|
var request_obj = new Object();
|
||||||
request += '"request":{';
|
request_obj.json_data = new Object();
|
||||||
if (this.parameters)
|
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++)
|
for (var i = 0; i < this.parameters.length; i++)
|
||||||
{
|
{
|
||||||
if (i > 0)
|
request_obj.json_data.request.parameters.push(this.parameters[i]);
|
||||||
{
|
|
||||||
request += ',';
|
|
||||||
}
|
}
|
||||||
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
|
//Send the request via the jquery AJAX interface to the server
|
||||||
$.ajax({url: this.url + '?menuaction=' + this.menuaction,
|
$.ajax({url: this.url + '?menuaction=' + this.menuaction,
|
||||||
|
Loading…
Reference in New Issue
Block a user