1

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!

DTondin
  • 147
  • 1
  • 2
  • 9

1 Answers1

1

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.

Pre101
  • 2,370
  • 16
  • 23
  • Thank you! We use the Ajax option and worked with text and similar files. But there is a way to open files like .pdf, images and zip's? – DTondin Jul 31 '13 at 12:06
  • Check these: https://github.com/mozilla/pdf.js/ and http://gildas-lormeau.github.io/zip.js/ – Pre101 Jul 31 '13 at 16:05