Update script.js

Fixing a bug where if there is an empty line in data.txt, it would crash the browser.