update script.js, fixed invalid input bug on gh-pages.