You are not logged in.

chrishunk

Beginner

  • "chrishunk" started this thread

Posts: 5

Location: Shenzhen, China

Occupation: Web developer

  • Send private message

1

Thursday, November 7th 2013, 7:25am

How to use the js file(embedded the xml file from protect tool)?

Hello Everyone:
I generated a js file embedded xml file in it with protect tool. now I don't know how to use it in html, it always show 'test.js - loading or parsing failed '.


there is the code in html:

Source code

1
var viewer = createPanoViewer({swf:"krpano.swf", xml:"test.js", target:"panocontent"}); 



Thanks.

Alexey Tkachenko

Professional

Posts: 770

Location: Russian Federation

Occupation: Interpreting, Building virtual tours

  • Send private message

2

Thursday, November 7th 2013, 9:26am

Hi! I thought that html has a special place for the .js file. See here:

Source code

1
2
3
4
5
6
7
8
<script src="tour.js"></script>

<div id="pano" style="width:100%;height:100%;">
	<noscript><table style="width:100%;height:100%;"><tr style="valign:middle;"><td><div style="text-align:center;">ERROR:<br/><br/>Javascript not activated<br/><br/></div></td></tr></table></noscript>
	<script>
		embedpano({swf:"tour.swf", xml:"tour.xml", target:"pano", html5:"auto", passQueryParameters:true});
	</script>
</div>


Maybe, place your .js where it should be (see where 'tour.js' is in the above example) and not try to hammer it in the place of .xml?

I've never tried embedding xmls into .js, however, so this is a guess only...
Regards,

Alexey

chrishunk

Beginner

  • "chrishunk" started this thread

Posts: 5

Location: Shenzhen, China

Occupation: Web developer

  • Send private message

3

Thursday, November 7th 2013, 10:36am

Hi! I thought that html has a special place for the .js file. See here:

Maybe, place your .js where it should be (see where 'tour.js' is in the above example) and not try to hammer it in the place of .xml?

I've never tried embedding xmls into .js, however, so this is a guess only...
Thank for your help. I tried, but it still says 'main.xml - loading or parsing failed '...