Changed the Javascript for getting the version

Found a better way to do it online.