New HTML Compiler - read external file?


Bryce Beattie
Is there a function to read a text file into a variable? I see in the docs a dhc.files.writeTextFile(), dhc.files.deleteFile(), and dhc.files.fileExists(), but no similar dhc.files.readTextFile().

decsoft

Hello Bryce,

Please, take a look at the "Files" sample app. There is no "readTextFile" because we can use a XMLHttpRequest ("jQuery.get()" for example) without problems in the new generation of DecSoft HTML Compiler. In the referred sample you can see how we read a text file (previously write) with the below Javascript code:


Everybody can read the DecSoft support forum for learning purposes, however only DecSoft customers can post new threads. Purchase one or more licenses of some DecSoft products in order to give this and other benefits.

This website uses some useful cookies to store your preferences.

I agree. Hide this note. Give me more information.