Hello all, I hope you can help me crack this one. I want to pass my tour's full url into the xml like Klaus has done in this example:
https://krpano.com/examples/10812…nk/getlink.html
I think I have implemented it but I find a strange behaviour, when offline I trace the "js_htmlpath" variable as: 'http://192.168.1.81:8090/index.html' (using the KRpano Test Server tool), but when I upload it into our website it traces it as a very incomplete 'http'. That's all I get.
This is the piece of code I am using inside the index.html container (which is basically the same as Klaus's with very minor changes like switching his http://krpano.swf/js to my already existing http://tour.swf/js or chopping off the parts I don't need):
<script>
var viewer = createPanoViewer({swf:"tour.swf", id:"krpanoObject", target:"krpanoDIV"});
// set the default xml file
viewer.addVariable("xml", "tour.xml");
viewer.addVariable("lang", "esp.xml");
// pass all parameters from the html file to the viewer
viewer.passQueryParameters();
// pass the url of the html file to the viewer
var curhtmlpath = String(document.location);
curhtmlpath = curhtmlpath.substring(0,curhtmlpath.indexOf(".html")+5);
viewer.addVariable("js_htmlpath", curhtmlpath);
// embed and start the viewer
viewer.embed();
</script>
Display More
Inside the xml I'm simply tracing the variable with the aforementioned results.
Thanks a bunch!