Hello
I am trying to access hotspots in my panos using javascript. Specifically I want to pull out the 'pic' attribute for every hotspot in the current pano. This implementation is being used for a phonegap iOS app. I have tried using ajax to pull the information
$(document).ready(function(){
$.ajax({
type: "GET",
url: "panos-tpz-browser.xml",
dataType: "xml",
success: function(xml) {
$(xml).find('scene').each(function(){
scene[i][0] = $(this).attr('name');
$(this).find('hotspot').each(function(){
scene[i][j] = $(this).attr('pic');
j++;
});
i++;
j=1;
});
}
});
});
Display More
This did not work, for some reason it can not get past the "$(xml).find('scene').each(function(){" line. I think ajax would be the best method for me to access the data and keep it organized.
I have looked into using the 'get' method on the krpano object
var kr = document.getElementById("krpanoSWFObject");
var newscenename=kr.get('scenename');
alert(newscenename);
for (var i=0;i<350;i++){
var newhotspotname=kr.get('pic');…
But my attempts to use this have also been unsuccessful. I get a 'TypeError: Object #<HTMLEmbedElement> has no method 'get'' when testing in chrome.
Does anyone have advice about how to get one of these methods working or an alternate method of pulling the data?
Thank you in advance for any help.