added javascript data updating when press "next" and "prev"