0

How to call AC_VHost_Embed twice

asimonok 4 years ago in SitePal Platinum 0

Hi

My problem is: I have the react app and one of the page need to use sitepal scene via AC_VHost_Embed

function. But if we go to another page and return back on the page with scene without reloading page. How to init scene again? if call AC_VHost_Embed again will be thrown exception

add_html.js:1 Uncaught TypeError: Cannot set property 'innerHTML' of null
    at vhsshtml5_onaddhtmlcall (add_html.js:1)
    at HTMLScriptElement.vhsshtml5_add_html_jsLoaded (VM5997 vhost_embed_functions_v2.php:480

Also I use following code to include needed scripts.

//vhss-d.oddcast.com/vhss_players/sitepal/js/react_js_embed.js
//vhss-d.oddcast.com/vhost_embed_functions_v2.php?acc=${ENV.sitepal.accountId}&js=1

My html code

<div id="vhssHTML-character"></div>


When I reload the page scene works fine.

Do you have any ideas how to resolve this problem?