xml data information passing.

  • wanted to add data information for each pano through xml.

    I am loading panorama through custom navigation with javascript loadpano() sort of.
    would wish that event fire one more information

    1 : Panorama Name :
    2 : Panorama text inforamtion to be pushed in two different div's foo_title and foo_desc

    can anyone explain how to add data information in xml and pull it and push it to div's ?

    Regards
    Mak

  • thanks klaus for prompt reply.

    Say i have one html page with four DIV in it.

    on top navigation header div

    then player in krpanoDIV

    under that i have fContainerDIV

    and inside fContainer i have two section

    ftitleDIV | fdescDIV

    ...

    i have menu in header div and on click i fire loadpano() to krpanoDIV

    i want to send some more text information to update
    ftitleDIV and fdescDIV from that navigation on each link i have.

    hope this helps.

    Regards
    Mak

  • okay, you want to send data from krpano to html/js or from html/js to krpano?

    for krpano to html/js - use the js() action,
    e.g.
    xml:

    Code
    ... onclick="js ( jsfunction('hello from xml') );"

    html/js:

    Code
    function jsfunction(msg)
    {
      alert(msg);
    }

    or for html/js to krpano - use the set/get/call interface,
    html/js:

    Code
    var krpano = document.getElementbyId("krpanoSWFObject"); // use the ID from embedding
    krpano.set("anyvalue", "test123");
    krpano.call("trace('hello from js anyvalue=',anyvalue);");

    best regards,
    Klaus

  • it worked. only thing now i have to do is find solution to pass html text.

    e.g.

    Code
    <b>Creating a paradigm shift, the hotel's many "first-of-its-kind" makes it stand apart from the rest.</B> The 55,000 square feet magnificent tropical lagoon sets the stage for magical moments. The world's 'larges

    the text i am passing does not support html or special characters to pass. so i have to remove even ' from the text (e.g don't) ..


    Here is javascript i call from xml

    Code
    function xmlpass(p1, p2, p3)
    {	
    	document.getElementById("divshowcontent").innerHTML = "<span><strong>" + p1 + "</strong></span>";
    	document.getElementById("comment_right").innerHTML = "<span><strong>" + p2 + "</strong><br>" + p3 + "</span>";	
    	return p1;
    }

    here is div defined to write text from javascript to

    Code
    <div class="commenttext_left" id="divshowcontent"></div>
    
    
    <div class="commenttext_right" id="comment_right"></div>

    any idea how to do ?

    Regards
    Mak

  • I m facing same problem,

    I have called js function for text,

    <krpano version="1.0.8" onstart="js( xmlpass('Public Area', 'Reception', 'testing html area','', '' )) ;" >

    Is it possible to add custom html tag like bold,italic,quotation mark in above XML(bold text) it self,


    Ruchit

  • Hey Mak:

    Hmm... Seeing this post from pinsane & Tuur (see the two replies above it in the thread) made me think it'd be a snap. However, that approach works fine in XML only -- as soon as I put a javascript call in, I get nothing, or undefined, a la:

    Code
    //JAVASCRIPT:
    var myText = krpano().call("get(data[myData].content);");
    document.getElementById("divshowcontent").innerHTML = "<span><strong>" + myText + "</strong></span>";
    
    
    <!-- XML: -->
    <data name="myData">
    	<p>Hello<br />World</p>
    </data>

    Seeing this post made me hopeful, too -- but I can't get it to work. Maybe check in with Tuur & Pinsane in those threads... And keep me posted!

    Tuur? You listening? *smile*

    Patrick

    (this post is related to conversation at this thread, re: javascript and iDevice orientation)

    QTVR • AS3 • 360° Photography • Art Gallery • Storefront • Books • Generative Art • ?

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!