Rewrite js code.
Merge pull request #1 from KingYes/dev

Rewrite js code.