Wrong escaped arguments passed in external JS interface call (version 1.0.8.12 an up)

  • Hi,

    When using the js action to call an external javascript function, escaped characters are passed as null.

    I've tested this on krpano version 1.0.8.12 and 1.0.8.14 (build 2011-02-09), with flashplayer LNX 10.2.161.22 Plugin, in Firefox and Chrome.

    For example, when this action is triggered:

    Code
    js(show_in_console(one, two););

    the javascript function receives this parameter:

    Code
    onenullCnulltwo


    This is the setup I use to reproduce the error:

    XML file:

    Code
    <krpano version="1.0.8" showerrors="true" basedir="%CURRENTXML%" onstart="action(js_test);">
         ...    
      <action name="js_test">
    	    js(show_in_console(one%2C%20two););
    	    js(show_in_console(three%26four););
    	    js(show_in_console(six-four%2Bone%3Dthree););
       </action>
    </krpano>

    HTML file:

    Code
    <script type="text/javascript">
      var viewer = createPanoViewer({swf:"krpano.swf",target:"krpanoDIV"});
      viewer.addVariable("xml", "some.xml");
      viewer.embed();
      function show_in_console(text) {
    	console.log(text);
      }
    </script>

    OUTPUT:

    Code
    onenullCnulltwo
    threenullfour
    six-fournullBonenullDthree

    EXPECTED:

    Code
    one, two
    three&four
    six-four+one=three

Jetzt mitmachen!

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