Hi,
I want to access placeholder variables from js, such as %HTMLPATH%, %SWFPATH%, %CURRENTXML%,
I tried like below, however, none of them works:
document.getElementById('krpanoSWFObject').get('%SWFPATH%')
document.getElementById('krpanoSWFObject').get('SWFPATH')
document.getElementById('krpanoSWFObject').get('%$SWFPATH%')
Any ideas about how to access these variables?
Thanks
How can I get Placeholder variable values through js?
-
-
Some of these paths seem to be available as variables:
network.viewerpath
network.htmlpath
network.firstxmlpath
network.currentxmlpathso ....get('network.firstxmlpath') should work.
-
Thank you very much
-
use can use this function in javascript:
Code
Alles anzeigenfunction fix_path(path){ var network = krpano.get("global.network"); path = path.replace(/\%BASEDIR\%/g, network.basepath); path = path.replace(/\%FIRSTXML\%/g, network.firstxmlpath); path = path.replace(/\%CURRENTXML\%/g, network.currentxmlpath); path = path.replace(/\%HTMLPATH\%/g, network.htmlpath); path = path.replace(/\%VIEWER\%/g, network.viewerpath); path = path.replace(/\%SWFPATH\%/g, network.viewerpath); path = path.replace(/\%ROOT\%/g, network.viewerpath); return path; }
-
Hi,
for resolving the url placeholders you can also use the parsepath function:
https://krpano.com/docu/plugininterface/#parsepathBest regards,
Klaus
Jetzt mitmachen!
Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!