J'ai un fichier texte à la racine de mon application web http: //localhost/foo.txt et j'aimerais le charger dans une variable en javascript .. dans groovy je ferais ceci:
def fileContents = 'http://localhost/foo.txt'.toURL().text;
println fileContents;
Comment obtenir un résultat similaire en javascript?