Passing Variable from HTML to %$VARIABLE% placeholder in XML via JavaScript

  • Hi All,
    hi Klaus,

    I pass variables to my XML from the HTML in many cases successfully.

    Example is

    Zitat

    viewer= createPanoViewer({swf:"ANYPANO.swf", xml:"ANYPANO.xml", target:"pano", id:"krpanoSWFObject", html5:"auto", passQueryParameters:true, wmode:"opaque"});
    viewer.addVariable("root", window.location.href);
    ...

    The variable <root> can be adressed with this name within XML.

    Using this to follow the documentation given in:

    Zitat

    https://krpano.com/docu/xml/#url-notes

    ...
    %$VARIABLE% - Use the value of the given 'VARIABLE' - this can be
    any krpano variable,
    but it must be defined before the current xml or scene will be
    loaded, e.g. already in the html file or before loadpano(), loadscene()
    calls.

    in order to have a flexible INCLUDE STATEMENT like (using a placeholdername in my below example <myvariable_from_html_via_JS_here>

    Zitat

    <include url="%BASEDIR%/plugins/ %$myvariable_from_html_via_JS_here% / MyPanoDetailDefs.xml" />

    I get the XML load error showing the %$...% content unparsed.
    It looks, as if krpano does not parse the viewer.addvariable content into the %$...% construction.

    Any Ideas?

    Target:
    use all the same xml files but INCLUDE different PARAMETER xml-files for Panos flexible called from outside via html:

    Zitat

    www.<site>.<dom>/<file>.html#parameter1=<value1>?parameter2=<value2>

    BTW - the parsing and passing works fine with variable used and read with <action>s but nit with in the URL ATTRIBUTE.

    Thanks guys
    *smile*

    Honi soit qui mal y pense ! *thumbup*

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!