A Problem with Ajax response

I want to fill a second treebox with the AJAX response data.
The first tree is perfectly working. Then I do a

"encodeURIComponent(tree.serializeTreeToJSON())"

and send a sync AJAX Post Request.
in my process.php I get the POST value in a right way and then I just do this:

<?php
// just send back
$tree=htmlspecialchars_decode($_POST['tree']);
echo $tree;
?>

The JSON-string in $tree is exactly the same as provided from the DHX function. I proofed it.
And when I hardcode the value of $tree into the

 another_tree.loadJSONObject(data); 

instead of “data” (look in my javascript down here) everything works fine. I manually proofed it to tested with the JASON-string. And it seems to be well formatted JASON. And it is exactly the same data, the script posted with ajax before.

But If I use the variable “data”, nothing happens. With an “alert(data);” it just says [object OBJECT].
I have the same problem in SAFARI, FF and IE.
What is my mistake? :confused: I hope you can help me out of this.

Here my

[code]

[/code]

No Idea?

Seems to be a bug.
You can not use a Json Responce from webserver to generate a second tree?

:question:

loadJSONObject requires json object, not a string as a parameter. Moreover, postSync returns loader object. For example:

var loader = dhtmlxAjax.postSync(…);
var text = loader.xmlDoc.responseText;
if(text){
var data = JSON.parse(text);
tree.loadJSONObject(data);
}

Thank you, I fixed it with JSON.parse(loader); So it is everything well