You can write
function onSelectNode(selectedNode) {}
and then you can call it in your event binding
.bind("select_node.jstree", function (event, data) { onSelectNode(data.node); })
and then instead of trying to call select_node yourself, you can just call
onSelect(treeInstance.get_selected(true)[0])
Note: you should have already saved the tree link in a variable in the global scope in order to access it later
treeInstance = $('#div').jstree(true);
source share