how i reload animated html?

2 months 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?
2 months ago
Hi! There is no function in wordart.min.js to reload but you can try to change the size of the div element. It will force your word art to redraw.
2 months 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
2 months ago
Then try to add wordart.min.js after you add the div element. The script will be automatically executed even if page is loaded.
2 months ago
I think, providing a render or reload function is better to handle this from modern SPA frameworks
1 month ago
Thank you for you suggestion. We will consider it for inclusion in future versions of the software.
1 month ago
Is there any way to get notification of this functionality implementation?
1 month ago
I'll post it here. But we don't have immediate plans to implement this. Did my suggestion to add wordart.min.js after div element work?
1 month 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" ) ;
scriptTag.src = url;
return scriptTag;
Edited 17 Feb, 2020 09:06


Sign up or Login to post a reply.