I am trying to embed schema to this widget using Custom JS. You said it can’t use , so I tried this and it didn’t work. Any suggestions of embedding schema in the widget (used to inject schema on web2.0.).
// Create a element
const schemaScript = document.createElement(‘script’);
schemaScript.type = ‘application/ld+json’;
// Define your Schema.org JSON-LD
schemaScript.textContent = JSON.stringify({
“@context”: “https://schema.org”,
“@type”: “Person”,
“name”: “John Doe”,
“jobTitle”: “Software Engineer”,
“telephone”: “(425) 123-4567”,
});
// Append it to the current location in the DOM
document.currentScript.parentNode.insertBefore(schemaScript, document.currentScript);