Pulling External XML Data

  • Is it possible to have krpano pull an XML data file and plug that data into various parts of the tour? For example, if I have an xml file titled contact.xml that has an email address, phone number and website. Then in the tour.html file of the virtual tour, I have js functions like this:

    function openWebpage(){
    window.open('[WEBSITE]');
    }

    function sendEmail(){
    window.location.href = "mailto:[EMAIL]?subject=Request For More Information";
    }

    function openPhone(){
    window.location.href = "tel:[PHONE]";
    }

  • This can be done in many ways.

    1.email

    krpano code

    Code
    <action name="send_email">	
      js(sendEmail('email@dom.com','Request For More Information'));
    </action>


    Javascript code
    function sendEmail(email,info){
    window.location.href = "mailto:"+email+"?subject="+info;
    }

    2.webside

    krpano code

    Code
    <action name="open_www">	
    js(openWebpage('http://www.krpano.com'));
    </action>


    Javascript code
    function openWebpage(www){
    window.open(www);
    }


    3. tel

    krpano code

    Code
    <action name="open_tel">	
    js(openPhone('123456789'));
    </action>


    Javascript code
    function openPhone(num){
    window.location.href = "tel:"+num;
    }


    These examples are based on your code but it can be done differently directly in krpano xml code.

    reed this:
    js actions
    js in the xml

    example:


    Piotr


Jetzt mitmachen!

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