forked from rDrama/rDrama
fix
parent
d06f2772f2
commit
d335ea4e9c
|
@ -693,8 +693,8 @@
|
||||||
{% if offset %}
|
{% if offset %}
|
||||||
<script defer>
|
<script defer>
|
||||||
function loadMore(id, trigger) {
|
function loadMore(id, trigger) {
|
||||||
const btn = document.getElementById(trigger)
|
const btn = document.getElementById(trigger) // trigger button
|
||||||
const el = document.getElementById(id)
|
const el = document.getElementById(id) // target element to populate
|
||||||
const form = new FormData();
|
const form = new FormData();
|
||||||
const xhr = new XMLHttpRequest();
|
const xhr = new XMLHttpRequest();
|
||||||
|
|
||||||
|
@ -702,10 +702,10 @@
|
||||||
xhr.withCredentials=true;
|
xhr.withCredentials=true;
|
||||||
xhr.onload=function(){
|
xhr.onload=function(){
|
||||||
if (xhr.status==200) {
|
if (xhr.status==200) {
|
||||||
el.innerHTML = xhr.response;
|
el.innerHTML = xhr.response; // replace desired element with response html
|
||||||
btn.classList.style('display: none');
|
btn.style.display = "none"; // hide button
|
||||||
} else {
|
} else {
|
||||||
btn.disabled = false;
|
btn.disabled = false; // enable our button if GET fails
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
xhr.send(form)
|
xhr.send(form)
|
||||||
|
|
Loading…
Reference in New Issue