create js for index