我在 .js 文件中有一个数组,但我希望能够通过单行(无逗号)在 .txt 文件中创建我的数组。所以一个数组看起来像:
pickWords =
[
"Hi!",
"Welcome!",
"Hello!"
]
但相反,我想从 .txt 文件中提取数组......到目前为止,这是我的代码:
FileName = "/array1.txt"
'Open the file for input.
Set MyFile = fso.OpenTextFile(FileName, ForReading)
'Read from the file and display the results.
Do While MyFile.AtEndOfStream <> True
TextLine = MyFile.ReadLine
Document.Write TextLine & "<br />"
Loop
MyFile.Close
我想我正在寻找有关此主题的输入,因为当您在搜索中使用“文本”一词时,很难搜索网络。
新 嗯,抱歉,如果它不是 javascript,我将它从一个说它是 .. 在标签 JScript 下的网站拉出来。但也许 Jscript 不是 javascript。http://msdn.microsoft.com/en-us/library/h7se9d4f%28v=vs.85%29.aspx#Y342
好的,那么问题将是 ajax vs php 来拉取外部数组?