Minor bug fixed
This commit is contained in:
parent
827c0117a7
commit
2f9eea0e4e
|
@ -1,7 +1,7 @@
|
|||
class TPDF {
|
||||
|
||||
static display() {
|
||||
console.log(TPDF.xhr.responseText);
|
||||
// console.log(TPDF.xhr.responseText);
|
||||
|
||||
if (TPDF.xhr.readyState == 4 && TPDF.xhr.status == 200) {
|
||||
/* Clean up output div */
|
||||
|
@ -99,7 +99,11 @@ class TPDF {
|
|||
}
|
||||
|
||||
static submit() {
|
||||
/* Initialization */
|
||||
TPDF.xhr = new XMLHttpRequest();
|
||||
TPDF.output = document.getElementById('tpdfOutput');
|
||||
|
||||
/* AJAX */
|
||||
TPDF.xhr.onload = TPDF.display;
|
||||
TPDF.xhr.open('GET',
|
||||
'main.py?format=json' +
|
||||
|
@ -107,11 +111,13 @@ class TPDF {
|
|||
'&title=' + encodeURIComponent(document.querySelector('#tpdfForm input[name="title"]').value));
|
||||
TPDF.xhr.send(null);
|
||||
|
||||
TPDF.output = document.getElementById('tpdfOutput');
|
||||
/* Nice GUI */
|
||||
while (TPDF.output.firstChild) {
|
||||
TPDF.output.removeChild(TPDF.output.firstChild);
|
||||
}
|
||||
TPDF.output.childNodes[0].textContent = 'Searching...';
|
||||
var pStatus = document.createElement('p');
|
||||
pStatus.textContent = 'Searching...';
|
||||
TPDF.output.appendChild(pStatus);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
|
||||
<main>
|
||||
<div id="tpdfOutput">
|
||||
<span> </span>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
|
|
Loading…
Reference in New Issue