<!DOCTYPE html>
<html>
<head>
<title>读取文本文件示例</title>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
(document).ready(function() {.get('file.txt',
function(data) {
$('#content').text(data);
}
);
});
</script>
</head>
<body>
<div id="content"></div>
</body>
</html>