Update script.js for bug fixing

Fixed the button not responding as well as the location status from
append() to html() for overwrite.