All posts created by Linto

4 years ago
yup that's working but it's not the standard way

export const reloadScriptTag = url => {
const existingScriptTag = document.querySelector(`script[src="${url}"]`);
if (existingScriptTag) existingScriptTag.remove();
const scriptTag = document.createElement("script" ) ;
document.body.appendChild(scriptTag);
scriptTag.src = url;
return scriptTag;
};
Edited 17 Feb, 2020 09:06
4 years ago
Is there any way to get notification of this functionality implementation?
4 years ago
I think, providing a render or reload function is better to handle this from modern SPA frameworks
4 years ago
if we adding a div with class="tagul-word-cloud" & data-tagul-src="assets/wordart.json" dynamically after some time in dom, its not picked by wordart.min.js

you are using window.addEventListener( "load", () => {} ) to draw canvas if the div with data-tagul-src="assets/wordart.json" not available in dom at initial loading & its dynamically adding after some time
Edited 07 Feb, 2020 00:41
4 years ago
currently i'm using 2 wordarts in 2 different route, when i redirect(its not hard reload similar to clientside framework doing like react/angular) to second page its looking empty(no image in canvas), i need to hard refresh to draw it again then the first page become empty

is there any function available in wordart.min.js to reload if i'm changing URL?