debugging
This commit is contained in:
+10
-3
@@ -13,11 +13,18 @@ console.log("paginator.js wurde erfolgreich geladen!");
|
|||||||
|
|
||||||
function loadData() {
|
function loadData() {
|
||||||
const el = document.getElementById('s-res-data');
|
const el = document.getElementById('s-res-data');
|
||||||
if (!el) return [];
|
console.log("s-res-data Element:", el);
|
||||||
|
if (!el) { console.error('s-res-data Element nicht gefunden'); return []; }
|
||||||
|
const raw = el.textContent.trim();
|
||||||
|
console.log("Roher Inhalt (erste 500 Zeichen):", raw.slice(0, 500));
|
||||||
|
console.log("Roher Inhalt Länge:", raw.length);
|
||||||
|
if (!raw) { console.error('s-res-data ist leer'); return []; }
|
||||||
try {
|
try {
|
||||||
return JSON.parse(el.textContent);
|
const parsed = JSON.parse(raw);
|
||||||
|
console.log("Geparst, Anzahl Elemente:", parsed.length);
|
||||||
|
return parsed;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('Suchergebnis-Daten konnten nicht gelesen werden', e);
|
console.error('JSON.parse fehlgeschlagen:', e, raw.slice(0, 200));
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user