For this you must configure a local server (if you open the index.html locally you will receive an error Cross origin requests, for this it must be a server) with the following files:
index.html:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Page Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" type="text/javascript"></script>
<script src="app.js"></script>
</body>
app.js
$(document).ready(function () {
$.ajax({
url: "ejemplo.txt",
context: document.body,
crossDomain: true
}).done(function (response) {
//Datos de tu archivo en la variable response
document.write(response);
});
});
example.txt
Hola Mundo