${lastHtml} `; const blob = new Blob([full], { type: 'text/html' }); const a = document.createElement('a'); a.href = URL.createObjectURL(blob); a.download = 'json-data.html'; a.click(); URL.revokeObjectURL(a.href); } function loadExample() { $('#input').value = JSON.stringify([ { id: 1, name: 'Wireless Mouse', price: 29.99, inStock: true, category: 'Accessories' }, { id: 2, name: 'USB-C Hub', price: 49.00, inStock: false, category: 'Accessories' }, { id: 3, name: 'Mechanical Keyboard', price: 129.50, inStock: true, category: 'Peripherals' }, { id: 4, name: '4K Monitor', price: 399.00, inStock: true, category: 'Displays' } ], null, 2); convert(); } function setMode(m) { mode = m; document.querySelectorAll('.mode-btn').forEach(b => b.classList.toggle('active', b.dataset.mode === m)); convert(); } $('#modes').innerHTML = ['table', 'list', 'cards', 'raw'].map(m => `` ).join(''); $('#lbl-in').textContent = t('lblIn'); $('#lbl-out').textContent = t('lblOut'); $('#input').addEventListener('input', convert); $('#toolbar').innerHTML = ` `; GZ.renderToolPage({ category: 'dev', titleKey: 'toolTitle', descKey: 'toolDesc', howToSteps: ['step1', 'step2', 'step3', 'step4'], faqs: ['faq1q:faq1a', 'faq2q:faq2a', 'faq3q:faq3a'], related: [ { icon: '📋', href: '/dev/json.html', name: 'JSON Formatter' }, { icon: '🌲', href: '/dev/json-tree-viewer.html', name: 'JSON Tree Viewer' }, { icon: '📊', href: '/convert/csv-to-json.html', name: 'CSV to JSON' }, { icon: '📋', href: '/dev/json-to-markdown.html', name: 'JSON to Markdown' }, ] });