Update index.js

I added the codes:
line 237-258 and line 306-327 of the File js/index.js