我在我的网络应用程序http://localhost/foo.txt的根目录中有一个文本文件,我想将它加载到javascript中的变量..在groovy中我会这样做:
def fileContents = 'http://localhost/foo.txt'.toURL().text; println fileContents;
如何在javascript中获得类似的结果?
javascript
javascript ×1