javascript check if file exists on server