Hi! I was able to do it using a function that is called when a button is
pressed:
function exportTree(){
var v = $('#levels').jstree(true).get_json('#', {flat:true})
var levelsJson = JSON.stringify(v);
var xhr = new XMLHttpRequest();
xhr.open("POST", "/saveTree", true);
xhr.setRequestHeader('Content-Type', 'application/json;
charset=UTF-8');
xhr.send(JSON.stringify(levelsJson));
}
And, In perl:
my $json = $self->dumper($self->req->json);
$json = decode_json $json;
Thanks for all your help
--
You received this message because you are subscribed to the Google Groups
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.