load xml from external server into html

  • Hello,

    In my html file I have put :
    "

    Code
    <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

  • 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:

    XML
    <?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

    Code
    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

  • 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 !

  • 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

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!