9 lines
300 B
JavaScript
9 lines
300 B
JavaScript
document.addEventListener('DOMContentLoaded', () => {
|
|
const textId = window.location.pathname.split('/').pop();
|
|
|
|
fetch('/api/texts/' + textId)
|
|
.then(res => res.json())
|
|
.then(text => {
|
|
document.getElementById('text-detail').textContent = text.name;
|
|
});
|
|
});
|