<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="node_modules/jquery/dist/jquery.js"></script>
</head>
<body>
<div>
<p>题目</p>
<img src="q.PNG" alt="管理员没有上传题目"></img>
</div>
<div>
<p>答案</p>
<p id="pa"></p>
</div>
<div>
<p>解析</p>
<p id="ph"></p>
</div>
<p id="plast"></p>
<p id="pnext"></p>
<script>
$(document).ready(function() {
$('#pa').load('a.txt', function(response, status) {
if ( status == 'error') {
$('#pa').text('管理员没有上传答案');
}
});
$('#ph').load('h.txt', function(response, status) {
if ( status == 'error') {
$('#ph').text('管理员没有上传解析');
}
});
var url = window.location.href;
url = url.slice(0, url.length - 1);
var idx = url.lastIndexOf('/');
var first = url.slice(0, idx + 1);
var second = url.slice(idx + 1);
console.log(second);
second = Number(second);
$('#plast').html('<a href="' + first + (second - 1) + '">上一题</a>');
$('#pnext').html('<a href="' + first + (second + 1) + '">下一题</a>');
//console.log(url.lastIndexOf('/'));
//console.log(window.location.href);
//console.log(w)
});
</script>
</body>
</html>
help 通用html 1.0版
最新推荐文章于 2023-01-02 21:27:42 发布