${data.content}
`; }).join(''); // Append the rendered HTML content to the page document.getElementById('content').innerHTML = htmlContent; // Append a div element with a link to the source URL const linkElement = document.createElement('div'); linkElement.innerHTML = ` Source URL `; document.body.appendChild(linkElement); '; ?> ' ); // Render the HTML content based on the preview data const htmlContent = previewData.map((data, index) => { if (index === 0) return data; return `${data.content}
`; }).join(''); // Append the rendered HTML content to the page document.getElementById('content').innerHTML = htmlContent; // Append a div element with a link to the source URL const linkElement = document.createElement('div'); linkElement.innerHTML = ` Source URL `; document.body.appendChild(linkElement); } catch (error) { // Handle any errors that may occur during rendering or execution handleErrorCallback(error); }