fix
parent
db306e3ebc
commit
1e40128bdf
|
@ -696,17 +696,19 @@
|
||||||
const el = document.getElementById(id)
|
const el = document.getElementById(id)
|
||||||
const form = new FormData();
|
const form = new FormData();
|
||||||
const xhr = new XMLHttpRequest();
|
const xhr = new XMLHttpRequest();
|
||||||
|
|
||||||
xhr.open("post", "/viewmore/{{p.id}}/{{sort}}/{{offset}}");
|
xhr.open("post", "/viewmore/{{p.id}}/{{sort}}/{{offset}}");
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
el.classList.toggle('hidden');
|
||||||
}
|
}
|
||||||
xhr.send(form)
|
xhr.send(form)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<button class="mt-2 w-full btn btn-gray" onclick="loadMore('comment-section')">
|
<button class="mt-2 w-full btn btn-gray" onclick="loadMore('comment-section'); this.disabled = true;">
|
||||||
Load more comments
|
Load more comments
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
Loading…
Reference in New Issue