-
Notifications
You must be signed in to change notification settings - Fork 0
/
show.html
40 lines (35 loc) · 1.05 KB
/
show.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<!DOCTYPE html>
<html lang="en">
<head>
<title>梁某人</title>
<script src="https://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/pagedown/1.0/Markdown.Converter.js"></script>
</head>
<body>
<div id="root"></div>
</body>
<script>
const converter = new Markdown.Converter();
function show(url) {
$.ajax({
url: url,
type: 'get',
success: function (data) {
const html = converter.makeHtml(data);
$('#root').html(html);
}
});
}
function getQueryString(name) {
const reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
const r = (decodeURI(window.location.search.substr(1))).match(reg);
if (r != null) return unescape(r[2]);
return null;
}
$(document).ready(function () {
let path = getQueryString("path");
document.title = path.replace("md/", "惜缘破军[") + "]";
show(path + "?t=" + new Date().getTime());
});
</script>
</html>