fantastic5 — 2013-05-30T19:51:44-04:00 — #1
I have this code
When i write into textarea, save the file and make download....the file is empty. What's wrong?
fantastic5 — 2013-05-31T19:57:56-04:00 — #2
I found this:
When I put text with line breaks, and then keep the text on the disc is not with line breaks.
Anyone know help me?
pullo — 2013-06-01T02:36:39-04:00 — #3
I just had a look at the plugin you link to.
I created a dummy text with a few line breaks in it, then saved it to disk.
When I opened the file with Windows Notepad, the line breaks had been ignored.
However, opening the same file with any other editor (SciTe, DreamWeaver, Wordpad) caused the line breaks to be honoured.
Are you testing this in Windows Notepad?
This link explains why this is happening: http://superuser.com/questions/362087/notepad-ignoring-linebreaks
fantastic5 — 2013-06-01T08:18:00-04:00 — #4
I only have tried just with notepad, with another software works.
It's impossible solve the problem?
pullo — 2013-06-01T09:18:16-04:00 — #5
You cannot change the behaviour of Notepad, so the only option is to change the output of the plugin.
If you look at the example you link to, you can see that it determines what to save to the text file thus:
so you could hook in to that to filter out all new line characters and replace them with carriage returns.
var text = document.getElementById('data').value;
That might affect things in other editors, however.
fantastic5 — 2013-06-01T10:35:50-04:00 — #6
Tried that, but still did not work.
pullo — 2013-06-01T10:53:43-04:00 — #7
Works for me.
Here's a demo.
Go to the demo page, enter something of at least two lines into the text area, save the file to your PC and open it with Notepad (normally: right click file -> open).
If I do this on Win8 I see the output formatted correctly with line breaks.
What do you see?
fantastic5 — 2013-06-01T14:21:21-04:00 — #8
I forgot this: var text