Hello,
Json js-encoder generats incorrect json, which could not be parsed by drupal because of extra ",".
Also it ignored arrays hence arguments could not be passed to views.
This seems to work:
Drupal.toJson = function(v) {
switch (typeof v) {
case 'boolean':
return v == true ? 'TRUE' : 'FALSE';
case 'number':
return v;
case 'string':
return '"'+ v +'"';
case 'object':
var buffer = []
if (v instanceof Array) {
for(var i=0; i
buffer.push(Drupal.toJson(v[i]))
}
return "["+buffer.join(",")+"]"
} else {
for(var i in v) {
buffer.push(i+":"+Drupal.toJson(v[i]))
}
return "{"+buffer.join(",")+"}"
}
default:
return 'null';
}
};
Comments
Comment #1
dmitrig01 commentedFixed in the 1.0 version!
Comment #2
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.