javascript code to automatically download a dataset