עורך השפה שלי
תצוגה חיה של האתר מוכן
" ); iframeDocument.close(); iframeDocument.head.appendChild(style); iframeDocument.body.appendChild(documentElement); showPage(0); } /* ========================================= 10. הפעלה ועדכון בזמן אמת ========================================= */ const editor = document.getElementById("editor"); const preview = document.getElementById("preview"); const status = document.getElementById("status"); let updateTimer = null; function updatePreview() { try { buildWebsite(editor.value); status.textContent = "התצוגה מעודכנת"; status.style.color = "#8ee6a0"; } catch (error) { console.error(error); status.textContent = "שגיאה בבניית התצוגה"; status.style.color = "#ff7777"; } } editor.addEventListener("input", () => { status.textContent = "מעדכן..."; clearTimeout(updateTimer); updateTimer = setTimeout( updatePreview, 150 ); }); document.getElementById("clearButton").addEventListener("click", () => { editor.value = ""; updatePreview(); editor.focus(); }); updatePreview();