vendredi 1 septembre 2017

windows.open() with data URI close automatically

I've a html page that generate a csv with the following code:

var encodedUri = encodeURI(csvContent);
window.open('data:text/plain,' + encodedUri,'_blank').focus();

I'm using firefox in local and it generates correctly a new tab with the data in it, but with firefox or chrome, not in local, the window opens and then close almost immediately (no popup alert triggers)

how may I avoid this and get my file with no problems?




Aucun commentaire:

Enregistrer un commentaire