Example:
return new Promise(resolve => {
const scriptElementHeader = document.createElement('script');
// scriptElementHeader.src = "";
scriptElementHeader.innerHTML = data['seo_header_content'];
scriptElementHeader.onload = resolve;
document.head.appendChild(scriptElementHeader);
const scriptElementFooter = document.createElement('script');
// scriptElementFooter.src = "";
scriptElementFooter.innerHTML = data['seo_footer_content'];
scriptElementFooter.onload = resolve;
document.body.appendChild(scriptElementFooter);
const BreadcrumbSchema = document.createElement('script');
BreadcrumbSchema.type = "application/ld+json";
BreadcrumbSchema.innerHTML = '{"@context":"https://schema.org/","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"' + this.BaseUrl + '"},{"@type":"ListItem","position":2,"name":"PageName","item":"' + location.href + '"}]}';
BreadcrumbSchema.onload = resolve;
document.body.appendChild(BreadcrumbSchema);
});