I have a task: make tree class, and ALL methods like (add node, delete node, copy, move) must be called by ajax.
In index.php i wrote (tree must be displayed by loading file):
$tree = new Tree($data);
Tree was successfully created.
So, the question is: how can i work with object by ajax (add_node.php, delete_node.php, ...), that was created in index file?
The simpliest way in add_node.php file wrote again:
$tree = new Tree($data);
, but i dont think that it's good idea to produce another exactly the same object.
Other idea is to send a node php variable in js functions, but i dont know how to do this. I think that it is impossible.
Anyone have any idea? Thanks for any help