I trying to open a txt document in a enyo application for mobile and I didn't found anything, so can I open that file on the mobile browser or inside the application using javascript or other way?
Thanks!
I trying to open a txt document in a enyo application for mobile and I didn't found anything, so can I open that file on the mobile browser or inside the application using javascript or other way?
Thanks!
You should be able to use Ajax to request the file and the place the response into the content of an instance of a Control
. i.e.:
{name: "textfile"}
...
this.$.textfile.setContent(inResponse.data);
If you wanted to have HTML in it then you'll need to set the allowHtml
property to true
.
Check out https://github.com/enyojs/enyo/wiki/Consuming-Web-Services for more info on Ajax. And, yes, you use Ajax to request local (on device) files, too.