loading and reading files using javascript