I'm attempting to use jQuery to dynamically update the background of a div if it changes on the server, allowing the page to stay open with a refreshed background image.
Currently, I have code that successfully updates the content of #current div but struggles to modify the background image of #banner.
setInterval(function(){
$.get('/index.php',function(data){
$('#current').empty().append($('#current_refresh',data));
var banner_bg = $(data).filter( $('#banner').css('background-image') );
$('#banner').css('backgroundImage',banner_bg);
});
}, 5000);