Internet URL absolute path

  • Hello,
    I found that I have error messages in HTML5 when I try to download some files using full web address.

    http://portreti.bg360.net/kalin-terziyski.php

    Code
    ERROR: plugin[soundon] loading error: http://bg360.net/krpano/skin/soundon.png
    ERROR: plugin[soundoff] loading error: http://bg360.net/krpano/skin/soundoff.png
    Code
    <plugin name="soundon" url="http://bg360.net/krpano/skin/soundon.png" align="rightbottom" x="10" y="10" onclick="tween(soundinterface.volume,0,1,,stopallsounds();set(plugin[soundoff].visible,true);
    set(plugin[soundon].visible,false););" visible="false"/><plugin name="soundoff" url="http://bg360.net/krpano/skin/soundoff.png" align="rightbottom" x="10" y="10" onclick="set(soundinterface.volume,1);
    if(isflash == true,playsound3D(sound, %CURRENTXML%/sound.mp3, 20,15,360,1,0);,playsound(sound, %CURRENTXML%/sound.mp3,360,0););
    set(plugin[soundon].visible,true);set(plugin[soundoff].visible,false);"/>

    As I remember there wasn't such problem before. Perhaps there are some new rules for WebGL or CSS 3D which were brought by the browsers updates.

    How to resolve it, if I don't want to move all files into relative folders?


    Thank you!

  • Hi,

    the access from 'portreti.bg360.net' to 'bg360.net' is a cross-domain access!

    In HTML5 it is necessary that the server is sending the 'CORS header' together with the images to allow that access.

    e.g. when using an Apache Webserver (like in your case), simply create a '.htaccess' in the root folder of your example (or directly in the root folder of your server to allow access for all folders) with the following content:

    .htaccess:

    Code
    Header set Access-Control-Allow-Origin *


    Btw - regarding 'relatives' paths - you could also use relative paths to the root folder of the server to avoid cross domain access.
    E.g.: url="/krpano/skin/soundon.png"

    Best regards,
    Klaus

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!