1 (edited by maxl 2013-04-02 13:20:20)

Topic: A question about baseUrl embedding

Hi,

As I can not use the recommended "same folder as the HTML files" option I'm looking into using the baseUrl option for embedding my galleries.

I can also not upload any files to the domain for my webpage (weird CMS restriction) and would have to create a kind of subdomain that I can access by FTP.

I am slightly aware of the same domain policy for javascript.

My question is if this arrangement would work (and give full javascript functionality for the embedded gallery):

*URL of an article: www.mydomain.com/article

*baseUrl for image gallery: www.gallery.mydomain.com/galleries/articlegallery

Cheers,
Max

Re: A question about baseUrl embedding

No. That arrangement would not work.
All the Juicebox gallery files must be on the same domain/subdomain as the page containing the JavaScript embedding code.
Please see this web page for more information about the JavaScript same-origin policy.

If your JavaScript embedding code is on a page on www.mydomain.com, then the gallery files would also need to be on that domain.
Otherwise, you could embed your gallery using an <iframe> (documented as Option #2 here).
You could upload your gallery folder to www.gallery.mydomain.com (and the gallery would be actually be embedded in the 'index.html' file within the gallery folder on that domain) and you could then load the gallery's 'index.html' file into an <iframe> on a page on www.mydomain.com.
However, please note that when embedding a gallery in an iframe, the 'Expand Gallery' button is disabled and the 'Back Button' will not work.

Re: A question about baseUrl embedding

Thanks for the swift reply, very helpful. Think I'll go with the <iframe> option.