Download a file using Javascript

Actually, if you want a ‘more-efficient’ (and sexier) way, use:

location.href = your_url;

That way, you will save the compiler some time in going up to the location‘s prototype chain up to the window object.

Leave a Comment