You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Monday, January 11th 2010, 3:35pm

Javascript Problem with Chrome and Firefox

Hi, I have a loadpano function in Javascript wich works in Internet Explorer 7 but it doesn´t work in Chrome, Firefox and IE8...

The page is http://www.ecas.es/vuelos3d/raa/panotours/panos.htm

and its a call to load pano with a normal link.

Quoted


Example:

<a href="#" onclick="goto('panodata/P0016HD_LaVictoriaPertusa0.xml')">Ermita de la Victoria - Pertusa</a>

....

</script>

<script type="text/javascript" src="panodata/swfobject/swfobject.js"></script>
<script type="text/javascript" src="panodata/swfobject/swfkrpanomousewheel.js"></script>



<script type="text/javascript">

var random_xml = "pano" + (1+Math.floor(Math.random()*5)) + ".xml";

// <![CDATA[
if (typeof(deconcept) !== 'undefined' && deconcept.SWFObjectUtil.getPlayerVersion().major >= 6)
{
var so = new SWFObject("krpano_raa.swf", "krpanoSWFObject", "654", "450", "9.0.28","#000000");
so.addParam("allowFullScreen","true");
so.addVariable("pano", random_xml);
so.useExpressInstall("panodata/swfobject/expressinstall.swf");
so.setAttribute('xiRedirectUrl', window.location);
if ( so.write("krpano") ) { var mousewheelfixes = new SWFkrpanoMouseWheel(so); }
}
else
{
document.getElementById("krpano").innerHTML = '<table width="100%" height="100%"><tr valign="middle"><td><center>ERROR:<br><br>Necesitas Adobe Flash Player 9 o superior para ver la visita virtual panorámica<br><br><br><a href="http://www.adobe.com/go/getflashplayer/" target="_blank"><IMG SRC="http://www.macromedia.com/images/shared/…lash_player.gif" BORDER="1"></a><br>...click here to download...<br><br><br><br></center></td></tr></table>';
}
// ]]>
</script>


<script type="text/javascript">
function krpano()
{
return document.getElementById("krpanoSWFobject");
}

function goto(xml)
{
krpano().call( "loadpano("+xml+",null,MERGE,BLEND(1));" );
}


</script>

The code loads the first pano but after that the link doesn´t work.

Anyone have a similar problem and can help me?, thank you vey much

Ramón Salanova

2

Tuesday, January 12th 2010, 2:51pm

Hi,
<a href="#"
try removing the href="#", just use the onclick,
I think this is the problem...

best regards,
Klaus

3

Wednesday, January 13th 2010, 11:28am

Klaus, thank you four quick answer. Sorry but it doesn´t work without the href="#".

In internet explorer 8 says that is a problem of error script, null is not an object.

I am trying to change the code buttons to test all the link ways.

Is there another way to load another pano?. It works in your javascript example and its the same code, i don´t know.

I´ll keep testing, thank you very much for oyur help.



Ramon

4

Wednesday, January 13th 2010, 1:51pm

Hi,

I found the problem - different case

see:
var so = new SWFObject("krpano_raa.swf", "krpanoSWFObject", "654", "450", "9.0.28","#000000");

and:
return document.getElementById("krpanoSWFobject");

best regards,
Klaus

5

Wednesday, January 13th 2010, 8:38pm

Thank you very much Klaus, sorry for the extra work for a letter and thank you vey much again.
I have solved the problem and it works perfectly also with the "#" link which is usefull because its lead to the top of the page.

Thanks a lot.



Ramon