מהדר שפת א

קוד בשפת א

"; html += ""; return html; } /* הגנה על HTML */ function escapeHTML(text) { return String(text) .replace(/&/g, "&") .replace(//g, ">") .replace(/"/g, """) .replace(/'/g, "'"); } /* פתיחת האתר בעמוד חדש */ function openResult() { var blob = new Blob( [generatedHTML], { type: "text/html" } ); var url = URL.createObjectURL(blob); window.open(url, "_blank"); setTimeout(function() { URL.revokeObjectURL(url); }, 60000); } /* העתקה */ function copyHTML() { if (!generatedHTML) { return; } if (navigator.clipboard) { navigator.clipboard.writeText(generatedHTML) .then(function() { document.getElementById("message").innerHTML = "ה־HTML הועתק."; }); } else { var box = document.createElement("textarea"); box.value = generatedHTML; document.body.appendChild(box); box.select(); document.execCommand("copy"); document.body.removeChild(box); document.getElementById("message").innerHTML = "ה־HTML הועתק."; } } /* הורדת קובץ */ function downloadHTML() { if (!generatedHTML) { return; } var blob = new Blob( [generatedHTML], { type: "text/html" } ); var url = URL.createObjectURL(blob); var link = document.createElement("a"); link.href = url; link.download = "site.html"; document.body.appendChild(link); link.click(); document.body.removeChild(link); setTimeout(function() { URL.revokeObjectURL(url); }, 1000); }