I'm trying to read a list of images from a folder to create DIVs with image backgrounds (for use as an image slider). The jQuery I've written is as follows:
$.getJSON('../functions.php', function(images) {
images.each( function() {
$('#main').prepend('<div class="slider" style="background-image:url(' + ' (this) + ');"></div>');
});
});
This isn't working, unfortunately... The error message I get in console is:
Uncaught SyntaxError: Unexpected token ILLEGAL
What am I doing wrong? Thanks!