-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpatch_note.js
More file actions
24 lines (22 loc) 路 934 Bytes
/
Copy pathpatch_note.js
File metadata and controls
24 lines (22 loc) 路 934 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/// <reference path="node_modules/@types/jquery/index.d.ts" />
$(window).on("load", function () {
const waiter = $("div.patch-note");
const request = new XMLHttpRequest();
request.open('GET', "https://julmanbot.github.io/patch_notes.json");
request.send();
request.onerror = function () {
waiter.html("<strong>Une erreur est survenue lors de la r茅cup茅ration du patch note ! 馃槺</strong>")
}
request.onload = function () {
/**
* @type {{title: string, content: string}[]}
*/
const patch_notes = JSON.parse(request.response);
if (request.status != 200) {
waiter.html(`<p>Une erreur est survenue lors de la r茅cup茅ration du patch note ! 馃槺 (Code ${request.status})</p>`)
} else {
const patch = patch_notes[0];
waiter.html(`<div class=\"pn\"><h3>${patch.title}</h3>${patch.content}</div>`)
}
}
})