From cd64cd0794c99bcaf5db0b5b9f0ad9dcce67816d Mon Sep 17 00:00:00 2001 From: Kayan Almeida Date: Tue, 9 Dec 2014 15:46:45 -0200 Subject: [PATCH] Corrigindo o nome da Hint; Acertando Download do csv (Marquinho e Vitor Costa); --- public/index.html | 4 ++-- public/relatorioCodigo.js | 10 ++-------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/public/index.html b/public/index.html index d2c8fd6..aafb4a2 100644 --- a/public/index.html +++ b/public/index.html @@ -191,11 +191,11 @@

Preencha as informações abaixo

- +
- +
diff --git a/public/relatorioCodigo.js b/public/relatorioCodigo.js index f5dfb9a..ecebada 100644 --- a/public/relatorioCodigo.js +++ b/public/relatorioCodigo.js @@ -323,10 +323,7 @@ window.onload = function() { csv += bus[0] + "," + bus[1] + "," + bus[2] + "," + bus[3] + "," + bus[4] + "," + bus[5] + "," + bus[6] + "\n"; }); var encodedUri = encodeURI(csv); - var link = document.createElement("a"); - link.setAttribute("href", "data:text/csv;charset=utf-8," + encodedUri); - link.setAttribute("download", "onibus.csv"); - link.click(); + document.location.href = "data:text/csv;charset=utf-8,"+ encodeURI(csv).replace("\n", "%0A"); } if(result.lines != undefined) { var csv = "LINHAS\n"; @@ -334,10 +331,7 @@ window.onload = function() { csv += line + "\n"; }); var encodedUri = encodeURI(csv); - var link = document.createElement("a"); - link.setAttribute("href", "data:text/csv;charset=utf-8," + encodedUri); - link.setAttribute("download", "linhas.csv"); - link.click(); + document.location.href = "data:text/csv;charset=utf-8,"+ encodeURI(csv).replace("\n", "%0A"); } }); }