i have a a tree structure of folders and documents. There are options to edit, delete, move and add new folders and documents. When the user do these actions I will have a jquery ajax call to update the database.
The question is how to refresh the tree structure when the update is done? it is not in an iframe or frame.
i don’t want to server to have to return HTML code using div tag and innerhtml value (which is what a lot of my searches come up with).
i am using jsp with java backend.
Currently the tree is just good old html but we might consider using a jquery plugin.
CSharpAtl has a good idea, you could use that as a starting point. As one of your JSON members, you could also include an XPATH of the portion that changed (and thus indicating what’s returned in the AJAX response), but that could start to get complicated very quickly. It may be quicker and easier (code-wise) just to return a whole (sub)tree, assuming it won’t make an unacceptable performance hit to your application.