Update static/script.js
Browse files- static/script.js +4 -1
static/script.js
CHANGED
@@ -12,9 +12,12 @@ textGenForm.addEventListener('submit', async (event) => {
|
|
12 |
|
13 |
const textGenInput = document.getElementById('text-gen-input');
|
14 |
const textGenParagraph = document.querySelector('.text-gen-output');
|
|
|
15 |
|
16 |
try {
|
17 |
-
|
|
|
|
|
18 |
} catch (err) {
|
19 |
console.error(err);
|
20 |
}
|
|
|
12 |
|
13 |
const textGenInput = document.getElementById('text-gen-input');
|
14 |
const textGenParagraph = document.querySelector('.text-gen-output');
|
15 |
+
<a href="javascript:window.print();">打印</a>
|
16 |
|
17 |
try {
|
18 |
+
text_out = await translateText(textGenInput.value);
|
19 |
+
text_out = text_out+"\n"+"s";
|
20 |
+
textGenParagraph.textContent = text_out;
|
21 |
} catch (err) {
|
22 |
console.error(err);
|
23 |
}
|