minimal two-way communication between js and r