Assuming you can access the flat file file in http://www.example.com/flatFileDB.txt, and your HTML file has a div with an identification value random-phrase:
var request = new XMLHttpRequest();
request.onload = function() {
var fileContent = this.responseText;
var fileContentLines = fileContent.split( '\n' );
var randomLineIndex = Math.floor( Math.random() * fileContentLines.length );
var randomLine = fileContentLines[ randomLineIndex ];
document.getElementById( 'random-phrase' ).innerHTML = randomLine;
};
request.open( 'GET', 'http://www.example.com/flatFileDB.txt', true );
request.send();
XMLHttpRequest, .