BibliographyBackbone: Difference between revisions
From Illustrations in German Translations of Mark Twain's Works
No edit summary |
No edit summary Tag: Reverted |
||
| Line 24: | Line 24: | ||
overflow: auto; | overflow: auto; | ||
"></textarea> | "></textarea> | ||
</html> | |||
<script> | <script> | ||
async function testYears() { | async function testYears() { | ||
| Line 67: | Line 67: | ||
}); | }); | ||
</script> | </script> | ||
Revision as of 00:41, 12 May 2026
Bibliography Generator
<script> async function testYears() {
console.log('testYears aufgerufen');
const output = document.getElementById('bibOutput');
if (!output) {
console.error('bibOutput nicht gefunden');
return;
}
output.value = 'Lade Daten...\n';
try {
const response = await fetch('https://illus.twainframe.org/BibliographyData?action=raw');
console.log('Response status:', response.status);
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const entries = await response.json();
console.log('JSON geparst, Anzahl Einträge:', entries.length);
let result = ;
entries.forEach((entry, index) => {
const year = entry.year && entry.year.trim() ? entry.year : 'unknown';
result += `${index + 1}. ${year}\n`;
});
output.value = result;
console.log('Fertig');
} catch (error) {
output.value = `ERROR: ${error.message}`;
console.error('Fehler:', error);
}
}
document.addEventListener('DOMContentLoaded', function() {
const btn = document.getElementById('testBtn');
if (btn) {
btn.addEventListener('click', testYears);
console.log('Button bereit');
}
}); </script>