-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathget_publications.html
35 lines (32 loc) · 1.33 KB
/
get_publications.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
{% assign publication_link = include.pub_link%}
<script>
let link = "{{publication_link}}"
let xhttp = new XMLHttpRequest();
let page = location.search;
xhttp.onreadystatechange = function () {
if (this.readyState === 4 && this.status === 200) {
var parser = new DOMParser();
var doc = parser.parseFromString(this.responseText, "text/html");
var container = document.createElement("div");
var all_p = doc.getElementsByTagName("p");
var u_list = document.createElement("ul");
u_list.className = "publication-items";
for (p in all_p) {
if (all_p[p].innerHTML !== undefined){
var d = document.createElement("li");
d.innerHTML = all_p[p].innerHTML;
d.className = "publication";
u_list.appendChild(d);
}
}
container.append(u_list);
var nav_items = doc.getElementsByClassName("pagination-block")[0];
if (nav_items !== undefined){
container.append(doc.getElementsByClassName("pagination-block")[0]);
}
document.getElementById("publicationlist").appendChild(container);
}
};
xhttp.open("GET", link + page, true);
xhttp.send();
</script>