mkoryak mkoryak - 1 month ago 11
Javascript Question

easiest way to open a download window without navigating away from the page

What is the best cross browser way to open a download dialog (lets assume we can set content-disposion:attachment in the headers) without navigating away from the current page, or opening popups, which doesnt work well in IE6.

Answer

This javascript is nice that it doesn't open a new window or tab.

window.location.assign(url);