2
How to create a javascript function that generates a.ini file?
For example, I will fill in 2 fields and it will generate a file like this
[teste]
nome: "campo 1 que vou preencher"
teste: teste
teste: teste
email: "campo 2 que vou preencher"
teste: teste
teste:
That would be it, then the person clicks on Save or Download and downloads the file I’m trying to use Filesaver, but I’m having trouble even to run his demo
I tried in another way too more or less like this
$('#salvar').click(function() {
var nome = $('#nome').val();
var email = $('#email').val();
this.href = "data:text/plain;charset=UTF-8," + encodeURIComponent(texto);
});
You want to generate content in Javascript and make it so that when the user clicks a download with a file starts, that’s it?
– Sergio
This, for example, the user fills two fields and when clicking on Save/Download, the.ini file will be downloaded to him with the default file data + the data he fills in
– João
The tag
node.js
does not apply to this question.– zentrunix