Embedding the XML into the HTML

  • Hi there, I hope somebody can help!

    I'm trying to find a way to embed the main tour.xml into the main tour.html file, rather than just reference it in the 'embedpano' script. Is this something anybody knows is possible? Currently this is how I'm referencing the xml:

    "embedpano({xml:"tour.xml", target:"pano", html5:"only", mobilescale:1.0, passQueryParameters:true});"

    Any ideas on how to self-contain the xml within the html, as such?

    Many thanks! :)

  • Hi,

    you could use 'null' for the xml, use the onready callback and then call the loadxml action.

    E.g.

    Code
    var your_xml = "<krpano><preview type='grid()'/></krpano>';
    
    
    embedpano({xml:null, target:"pano", onready:function(krpano)
    {
    	krpano.call("loadxml(" + escape(your_xml) + ")");
    }});

    Best regards,
    Klaus

Participate now!

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