Update script.js

fixed html escaping and flashes