Add JS for live generation of ref urls