I am currently utilizing jQuery slimbox along with its Application Programming Interface (API).
Below is the JavaScript code snippet that retrieves image paths through JSON and then triggers the slimbox using its API.
$('#main-container').append('<span id="check-our-adverts">Check our Adverts</span>');
var advertImages = [];
$.getJSON( config.basePath + 'get-adverts/', function(images) {
advertImages = images;
});
$('#check-our-adverts').click(function() {
console.log(advertImages);
$.slimbox(advertImages, 0);
});
The JSON data returns
["\/~wwwlime\/assets\/images\/adverts\/advert.jpg","\/~wwwlime\/assets\/images\/adverts\/advert2.jpg"]
.
You can view the actual page here. Click on the top red box next to the frog. Inspect the console for the returned JSON output.
Upon examining the request with Live HTTP Headers, it appears that slimbox is only requesting vanquish.websitewelcome.com/
.
This issue leads to the perpetual spinning of the slimbox throbber upon launch.
Any ideas on what could be causing this complication? Thank you
Update
I have included this section within the JSON callback function:
$.each(images, function(i, image) {
$('body').append('<a href="' + image + '">link</a>');
});
Clicking on these links now directly takes me to the respective images... why is this happening?