begin js for view