12 lines
796 B
JavaScript
12 lines
796 B
JavaScript
|
|
// ═══════════════════════════════════════════════════════
|
||
|
|
// HTML Entities
|
||
|
|
// ═══════════════════════════════════════════════════════
|
||
|
|
async function htmlEntOp(op) {
|
||
|
|
const text = document.getElementById('htmlEntInput').value;
|
||
|
|
if (!text) return setStatus('htmlEntStatus','error','Enter text.');
|
||
|
|
const d = await apiPost('/api/html/' + op, { text });
|
||
|
|
if (d.success) { document.getElementById('htmlEntOutput').value = d.result; setStatus('htmlEntStatus','success', op === 'encode' ? 'Encoded ✓' : 'Decoded ✓'); }
|
||
|
|
else setStatus('htmlEntStatus','error', d.error);
|
||
|
|
}
|
||
|
|
|