You are not logged in.

1

Tuesday, July 17th 2012, 7:58pm

[HELP] Javascript errors

Hi All,

Just bought my licnese and trying to deploy a panorama.

Directory:

Source code

1
2
3
4
5
6
panos/
  capri/
      tour.php
      living.xml
      living.jpg
      krpano.swf


in tour.php, I am attempting to embed the pano as follows:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
<script src="../../scripts/javascript/swfkrpano.js"></script>
    <script>
  	embedpano({swf:"krpano.swf",xml:"living.xml",target:"tourwindow"});
	</script>
    <!--[if lt IE 9]>
	<link rel="stylesheet" href="scripts/IEHacks.css" type="text/css" />
	<![endif]-->
</head>
<body id="tours">
<div id="tourwindow" style="width:300px; height:200px; float:left;"></div>
</body>
</html>


The pano fails to load at all, and a Javascript error is thrown:

Source code

1
TypeError: 'null' is not an object (evaluating 'n.innerHTML=this.getSWFHTML()') - swfkrpano.js:line 16


Desperate to get this resolved, so any help would be great here!

Thanks

Ben

2

Tuesday, July 17th 2012, 8:48pm

Ignore me - I'm an idiot.

I have the call to embedPano coming before the DOM had rendered.

I need sleep.

3

Friday, July 20th 2012, 10:30am

Hi,

just as clarification (if someone other reads the thread):

the 'embedpano()' call needs to be in the html <body> element after defining the target/pano html element.

Best regards,
Klaus