/*I want to fill my javascript list with elements from txt file. Each line as element.
I can fill my list manually. But not with elements from txt file.
此函数返回1和2(每个30秒后)。我想返回.txt文件的内容(逐行)。 * /
<script>
var text = ["1","2"];
var counter = 0;
var elem = document.getElementById("changeText");
var inst = setInterval(change2, 30000);
function change2() {
elem.innerHTML = text[counter];
counter++;
if (counter >= text.length) {
counter = 0;
}
}
</script>