tags within the JSON string (rare, but good practice)
jsonLdString = jsonLdString.replace(/<\/script>/g, '<\\/script>');
script.textContent = jsonLdString;
// Append to the head or body (head is preferred for structured data)
document.head.appendChild(script);
}
} catch (e) {
// Log any errors during schema generation (useful for debugging)
if (typeof console !== 'undefined' && typeof console.error === 'function') {
console.error("Gallery Gems Schema Error:", e);
}
}
});
})();