ajax: function(url, params, callback) {
params = this.serialize(params);
dhtmlxAjax.post(url, params, function(response) {
if (response.xmlDoc.responseText !== ‘’)
callback(eval(’(’ + response.xmlDoc.responseText + ‘)’));
->> UNCAUGHT SYNTAX ERROR: UNEXPECTED TOKEN <
});
},
serialize: function(params, parent) {
var parent_start = (!parent) ? '' : parent + '[';
var parent_end = (!parent) ? '' : ']';
var text = [];
for (var i in params) {
if (typeof(params[i]) == 'function') continue;
if (typeof(params[i]) == 'object')
text.push(this.serialize(params[i], (!parent)? i : parent + '[' + i + ']'));
else
text.push(parent_start + i + parent_end + "=" + encodeURIComponent(params[i]));
}
return text.join('&');
},