How would i append the text file into my contenteditable div?
Process only .txt files
Format if not properly formatted (apple-tab-span must be converted into
if possible)
Append to my contenteditable div
I know no.2 is way far from this question, just tell me how would i
process something like it. I've already finished the IDE-like system and
im about to add the Open and Save functions.
$('#open').addEventListener('change', getTextFile, false);
function getTextFile (e) {
var files = e.target.files;
var file = files[0];
var reader = new FileReader();
reader.onload = function() {
console.log(this.result);
}
reader.readAsText(file)
}
http://jsfiddle.net/3veCE/7/
No comments:
Post a Comment