pass nodes and links to js