migrate script fo jquery