Managed to find a solution for anyone who experiences this issue. I found that if I make a "direct call" to load xml, which I found in this post https://krpano.com/forum/wbb/inde…&threadID=16960, then it works. I hadn't seen this anywhere before but for some reason it fixes it. It works fine whether myXml is escaped or not. This ended up being the only change I needed to make.
Code
function krpano_onready_callback(krpano_interface) {
krpano = krpano_interface;
// this sometimes works and sometimes gives an XML parsing error
krpano.call("loadxml(" + myXml + ");");
// this works every time
var krpanoapi = krpano.get("global");
krpanoapi.actions.loadxml(myXml);
}
Alles anzeigen