append external text file to div
hi, i have multiple poems [3 in this trial] (held as external .txt files containing <br> line breaks) that i wish to display at random on each site visit.
I don't know how to load them into a specific 'div' area or (if necessary) assign them to a variable.
This is it so far - i'm afraid i'm a real newbie at this:
<script type="text/javascript">
var whichpoem=1+(Math.round(Math.random()*(2)));
var group='/poem'+whichpoem+'.txt';
var client = new XMLHttpRequest();
client.open('GET', group);
client.send();
$.get(group, function(data){
$("body").append(data);
});
</script>
thanks in advance.
g