This commit is contained in:
2025-05-26 21:19:38 +00:00
parent d3fa1733f4
commit 088e0cc5a3
9 changed files with 5 additions and 5 deletions
+16
View File
@@ -0,0 +1,16 @@
const textarea = document.querySelector('textarea');
const preview = document.getElementById('md_preview');
textarea.addEventListener('input', function() {
fetch('functions/preview.php', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
body: 'markdown=' + encodeURIComponent(this.value),
})
.then(response => response.text())
.then(data => {
preview.innerHTML = decodeURIComponent(data);
});
});