sync, implemented sort, viewing user pages & articles written, updating db
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
// Optional: Real-time preview using JavaScript
|
||||
const textarea = document.querySelector('textarea');
|
||||
const preview = document.getElementById('preview');
|
||||
|
||||
textarea.addEventListener('input', function() {
|
||||
fetch('preview.php', { // Create a separate preview.php file for real-time updates
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
},
|
||||
body: 'markdown=' + encodeURIComponent(this.value),
|
||||
})
|
||||
.then(response => response.text())
|
||||
.then(data => {
|
||||
preview.innerHTML = data;
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user