Topic: Config XML file not found - using configUrl

Both of the code samples below return file not found, any reason for this?:-

<script type="text/javascript">
    new juicebox({
        configUrl: "http://devmedia.steve-snell.me.uk/DataJB/Italy",
        containerId: "juicebox-container",
        galleryWidth: "940px",
        galleryHeight: "730px",
        backgroundColor: "rgba(34,34,34,0)"
    });
</script>

<script type="text/javascript">
    new juicebox({
        configUrl: "http://devmedia.steve-snell.me.uk/DataJB/Italy.xml",
        containerId: "juicebox-container",
        galleryWidth: "940px",
        galleryHeight: "730px",
        backgroundColor: "rgba(34,34,34,0)"
    });
</script>

Re: Config XML file not found - using configUrl

The path to the configUrl should include the full XML filename.
If your gallery's XML file is named 'Italy.xml' and is located in a folder named 'DataJB' then your second code sample should work.
Bear in mind that your web server is likely to be case sensitive so check the case (uppercase vs lowercase) of your folder and file names (e.g. 'italy.xml' is not the same as 'Italy.xml').
Also, all your gallery files should be hosted on the same domain so for your second code sample to work, your gallery folder should be uploaded to http://devmedia.steve-snell.me.uk
If you continue to experience difficulties, please post the URL to your gallery so that I can take a look.

Re: Config XML file not found - using configUrl

Did a bit of experimenting....

As you may well have noticed I am trying to dynamically load an xml file from an external server (devmedia is not where the web page exists).

So, I changed it to be as follows:-

<script type="text/javascript">
    new juicebox({
        configUrl: "/DataJB/Italy",
        containerId: "juicebox-container",
        galleryWidth: "940px",
        galleryHeight: "730px",
        backgroundColor: "rgba(34,34,34,0)"
    });
</script>

... and it works .... no '.xml' needed.

It means that I have to have a 'jump' call where "/DataB/Italy" calls the devmedia equivalent to retrieve the xml.

Why do I really have to do this though?

Re: Config XML file not found - using configUrl

Is 'Italy' a PHP page with no file extension (or something similar)?

Why do I really have to do this though?

By default, Juicebox looks for an XML file named 'config.xml' in the same directory as the HTML document into which the gallery is embedded. If you change the name or location of this file, then you must point towards it using the configUrl option.
Please see the Embed Options section of the 'Juicebox Configuration Options' page for details.

Re: Config XML file not found - using configUrl

"/DataJB/Italy" points to an Microsoft MVC3 controller method that returns xml depending on the url sent in (Here it's Italy).

Remember, as I said previously, it works correctly WITHOUT a domain name in front and WITHOUT '.xml' so it is valid what I am doing.

Can't see why it's not working with a domain name in front as it's only forming a url.

Re: Config XML file not found - using configUrl

Can't see why it's not working with a domain name in front as it's only forming a url.

The only thing I can think of is that your main HTML page (into which the gallery is embedded) might be hosted on a different domain or subdomain to the absolute URL you have specified as your configUrl (such as www.devmedia.steve-snell.me.uk). If so, this might explain the problem. Otherwise, I do not know.
However, I am glad that you have found a solution that works for you.

Re: Config XML file not found - using configUrl

It's hard to tell exactly whats going on without a gallery URL to look at. It sounds like you may be trying to load the XML from a different domain or subdomain than the one that is hosting the gallery files. JavaScript will fail loading data cross-domain.

Re: Config XML file not found - using configUrl

The gallery URL is:-

configUrl: "http://devmedia.steve-snell.me.uk/DataJB/Italy"

.... which is on a different domain.

Unfortunately, I didn't know that JS fails in this case ... is it a security thing?

I Used to use flash (now JB!!!!) that has a crossdomain thingy.

Re: Config XML file not found - using configUrl

is it a security thing?

Yes. Try a web search for 'JavaScript same origin policy'. There is a lot of information out there.

Re: Config XML file not found - using configUrl

Thanks for help.

At least it is working.