Ask away

Open a textfile in the NEST app on JS component

Bob 12/06/17 18:39

15 views

Question CategoryComponent,Properties,Miscellaneous

Number of completed projects0

Question StatusUnsolved

  • textfile
  • nest app
  • JS code

Question

I try to open a textfile in my NEST app and i also added the File control component Plugin. But I always get null on the second alert as the output of the reader. HTML-Input: <input type="file" id="file" onchange="handle_files(this.files)"> JS-code: function handle_files(files) { for (i = 0; i < files.length; i++) { file = files[i]; alert(file.name); var reader = new FileReader(); reader.onloadend = function(e) { alert(e.target.result); }; reader.readAsText(file); reader.onerror = function(stuff) { console.log("error", stuff); console.log (stuff.getMessage()); }; } }

Answers

1
Porter 12/12/17 09:52

Please try to execute with a console that should show you extra info, probably a configuration error (not a coding problem): I give you 3 alternatives: If you have Kit-kat device try with your CordovaWebview if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { CordovaWebView.setWebContentsDebuggingEnabled(true); } Using Winre

Answer

Project

Image

Comment