download file do not open new window

var downloadURL = function downloadURL(url)
{
var iframe;
iframe = document.getElementById("hiddenDownloader");
if (iframe === null)
{
iframe = document.createElement('iframe');
iframe.id = "hiddenDownloader";
iframe.style.visibility = 'hidden';
document.body.appendChild(iframe);
}
iframe.src = url;
}

from here

留言

這個網誌中的熱門文章

css unicode-range