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.

servaas

Intermediate

  • "servaas" started this thread

Posts: 204

Location: Belgium

  • Send private message

1

Monday, June 22nd 2015, 2:10pm

load xml from external server into html

Hello,

In my html file I have put :
"

Source code

1
2
3
<script>
embedpano({swf:"tour.swf", xml:"http://www.vanbelleb3d.be/ka91/tour.xml", target:"pano", html5:"auto", passQueryParameters:true});
</script>
"

The .html file is hosted on server 'A'. The .xml on server 'B'.
When I go to .html I got a error message 'FATAL: http://www....com/tour.xml - loading error (Security Error)'

What do I do wrong ? *unsure*

Cheers,
Servaas

2

Tuesday, June 23rd 2015, 11:19am

Hi,

there are two cases:

1. Flash - for Flash you need to have a crossdomain.xml on the other server (at best in the server root folder) that explicitly allows the Flashplayer to load files from that server.

That crossdomain.xml could look like this:

Source code

1
2
3
4
5
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
	<allow-access-from domain="*" />
</cross-domain-policy>


2. HTML5 - for HTML5 the other server needs to have CORS enabled. That means the server needs to send the

Source code

1
Access-Control-Allow-Origin: *
http header together with the files.

For enabling CORS on your external server see here - http://enable-cors.org/server.html


Best regards,
Klaus

servaas

Intermediate

  • "servaas" started this thread

Posts: 204

Location: Belgium

  • Send private message

3

Tuesday, June 23rd 2015, 12:05pm

Thanks Klaus, I'll check it out !

servaas

Intermediate

  • "servaas" started this thread

Posts: 204

Location: Belgium

  • Send private message

4

Tuesday, June 23rd 2015, 12:41pm

Hello,

I've asked my provider for assistance as the cross domain.xml didn't help so far.
Probably I've put it in the wrong place but soon this should be fixed.

As for a project I want the .js, .swf, and .xml files on a external server I've have this in my html file.
Can you confirm this is the right way ? Thanks in advance !

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<!DOCTYPE html>
<html>
<head>
	<title>krpano.com - tuin_01</title>
	<meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, minimal-ui" />
	<meta name="apple-mobile-web-app-capable" content="yes" />
	<meta name="apple-mobile-web-app-status-bar-style" content="black" />
	<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
	<meta http-equiv="x-ua-compatible" content="IE=edge" />
	<style>
		@-ms-viewport { width:device-width; }
		@media only screen and (min-device-width:800px) { html { overflow:hidden; } }
		html { height:100%; }
		body { height:100%; overflow:hidden; margin:0; padding:0; font-family:Arial, Helvetica, sans-serif; font-size:16px; color:#FFFFFF; background-color:#000000; }
	</style>
</head>
<body>

<script src="http://www.immo-virtueel.be/vtour_iv/tour.js"></script>

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

</body>
</html>

5

Tuesday, June 23rd 2015, 2:13pm

Hi,

normally you wouldn't need help your your provider/hoster, just upload a crossdomain.xml to the server root - and if you have an Apache server a .htaccess file (according to the CORS documentation link above) for HTML5.

Best regards,
Klaus

servaas

Intermediate

  • "servaas" started this thread

Posts: 204

Location: Belgium

  • Send private message

6

Tuesday, June 23rd 2015, 2:56pm

allright. The html5 has been fixed.

I'll keep on looking what I did wrong with the flash dude...