📅  最后修改于: 2022-03-11 15:02:49.632000             🧑  作者: Mango
$.get('txt/messages.txt', function(txt) {
var lines = txt.responseText.split("\n");
var randLineNum = Math.floor(Math.random() * lines.length);
return lines[randLineNum]; // random line from the text file
});