Topic: Get config.xml from ajax call

Hello,

Is it possible to now use the config.xml and get the xml format from a ajax call?

I haven't seen any documentation on how that is done? 

Is it only supposed by the pro version?



Thank you,
Brandon

Re: Get config.xml from ajax call

You can certainly load and parse an XML document (such as a gallery's 'config.xml' file) using AJAX. An example can be found here.

I'm not sure exactly what you are trying to do (perhaps you could explain in greater detail), but the likelihood is that it is possible with both Juicebox-Lite and Juicebox-Pro.

I hope the link above helps point you in the right direction.

Re: Get config.xml from ajax call

Hello,

All examples on the site show a static config.xml file on the server.  I don't need help with a ajax call, but instead am looking for documentation on how to set the collection of

<image imageURL="images/tall.jpg" thumbURL="thumbs/tall.jpg" linkURL="http://www.example.com" linkTarget="_blank" >
<title>This is my title.</title> <caption>This is my caption.</caption> </image>

once returned from the ajax call.  I don't want to have a static config.xml, but instead get the values from a server call dynamically and set those values in js.

Thank you,
Brandon

Re: Get config.xml from ajax call

The XML data has to be in its own separate file (it is not possible to simply pass a string of data to the configURL configuration option in the embedding code).
Also, the file containing the XML data has to be fully formed before Juicebox loads it.
This could be achieved with a server-side scripting language, such as PHP (which would create the XML file on the server before Juicebox loads it), but not with client-side JavaScript.

An example of how this can be achieved can be found in the answer to Query #3 in this forum post.

You could pull in data from whatever source you like and, instead of simply echoing the output, you could build an XML file using PHP DOM techniques.